Skip to content

Commit

Permalink
Sync servicemesh changes (#117)
Browse files Browse the repository at this point in the history
* feat(kserve): automates installation and configuration of KServe prerequisites (opendatahub-io#691)

* Implement installation and configuration of KServe prerequisites

KServe pre-requisites are:
* Service Mesh (Istio)
  * A minimal Control Plane is configured for KServe with only Pilot and default gateways.
  * An additional knative: ingressgateway is set for the Istio Ingress gateway workload.
  * Some ports are excluded from envoy to allow for metrics collection and KNative hooks.
  * Metrics collection is configured for Pilot and the gateways.
* Serverless (KNative)
  * Only serving components are needed from KNative.
  * For the most part, a typical Serving deployment is configured, with Istio as networking layer.
  * By default, a self-signed certificate is generated using the OpenShift Ingress domain. Users can provide their own secret with a production ready TLS certificate.

Signed-off-by: Edgar Hernández <23639005+israel-hdez@users.noreply.github.com>

* chore: updates apis/dscinitialization/v1/servicemesh_types.go

Co-authored-by: Cameron Garrison <cgarriso@redhat.com>

* wip: serverless as part of kserve

* chore: removes identitytype from CRD

* feat: ensures that serverless config is removed when KServe is enabled

* chore: checks if service mesh is configured when serving is enabled

* fix: returns error on fail to remove serverless

* chore(dsci): attempts to reduce test flakyness

* chore: removes misleading TODO

* Fix Dockerfile

Add new COPY statement, due to the new `infrastructure` directory

Signed-off-by: Edgar Hernández <23639005+israel-hdez@users.noreply.github.com>

* chore: regenerates bundle

---------

Signed-off-by: Edgar Hernández <23639005+israel-hdez@users.noreply.github.com>
Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
Co-authored-by: Cameron Garrison <cgarriso@redhat.com>

* Disable Service Mesh IOR (opendatahub-io#738)

This disables automatic OpenShift routes creation.

Signed-off-by: Edgar Hernández <23639005+israel-hdez@users.noreply.github.com>
(cherry picked from commit 2c6f48c)

* Add Defaults for new installs

---------

Signed-off-by: Edgar Hernández <23639005+israel-hdez@users.noreply.github.com>
Co-authored-by: Edgar Hernández <ehernand@redhat.com>
Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
Co-authored-by: Cameron Garrison <cgarriso@redhat.com>
  • Loading branch information
4 people authored Nov 15, 2023
1 parent 18e8fe0 commit 479b004
Show file tree
Hide file tree
Showing 56 changed files with 2,337 additions and 205 deletions.
3 changes: 2 additions & 1 deletion Dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ COPY components/ components/
COPY controllers/ controllers/
COPY main.go main.go
COPY pkg/ pkg/
COPY infrastructure/ infrastructure/

# Copy monitoring config
COPY config/monitoring/ /opt/odh-manifests/monitoring/
Expand All @@ -58,4 +59,4 @@ RUN chown -R 1001:0 /opt/manifests &&\
chmod -R a+r /opt/manifests
USER 1001

ENTRYPOINT ["/manager"]
ENTRYPOINT ["/manager"]
1 change: 0 additions & 1 deletion apis/datasciencecluster/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 11 additions & 43 deletions apis/dscinitialization/v1/dscinitialization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
conditionsv1 "github.com/openshift/custom-resource-status/conditions/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

infrav1 "github.com/opendatahub-io/opendatahub-operator/v2/infrastructure/v1"
)

// +operator-sdk:csv:customresourcedefinitions:order=1
Expand All @@ -35,9 +37,17 @@ type DSCInitializationSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=2
// +optional
Monitoring Monitoring `json:"monitoring,omitempty"`
// Configures Service Mesh as networking layer for Data Science Clusters components.
// The Service Mesh is a mandatory prerequisite for single model serving (KServe) and
// you should review this configuration if you are planning to use KServe.
// For other components, it enhances user experience; e.g. it provides unified
// authentication giving a Single Sign On experience.
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=3
// +optional
ServiceMesh infrav1.ServiceMeshSpec `json:"serviceMesh,omitempty"`
// Internal development useful field to test customizations.
// This is not recommended to be used in production environment.
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=3
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=4
// +optional
DevFlags DevFlags `json:"devFlags,omitempty"`
}
Expand Down Expand Up @@ -107,51 +117,9 @@ type DSCInitializationList struct {
Items []DSCInitialization `json:"items"`
}

// FeatureTracker is a cluster-scoped resource for tracking objects
// created through Features API for Data Science Platform.
// It's primarily used as owner reference for resources created across namespaces so that they can be
// garbage collected by Kubernetes when they're not needed anymore.
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
type FeatureTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec FeatureTrackerSpec `json:"spec,omitempty"`
Status FeatureTrackerStatus `json:"status,omitempty"`
}

func (s *FeatureTracker) ToOwnerReference() metav1.OwnerReference {
return metav1.OwnerReference{
APIVersion: s.APIVersion,
Kind: s.Kind,
Name: s.Name,
UID: s.UID,
}
}

// FeatureTrackerSpec defines the desired state of FeatureTracker.
type FeatureTrackerSpec struct {
}

// FeatureTrackerStatus defines the observed state of FeatureTracker.
type FeatureTrackerStatus struct {
}

// +kubebuilder:object:root=true

// FeatureTrackerList contains a list of FeatureTracker.
type FeatureTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []FeatureTracker `json:"items"`
}

func init() {
SchemeBuilder.Register(
&DSCInitialization{},
&DSCInitializationList{},
&FeatureTracker{},
&FeatureTrackerList{},
)
}
91 changes: 1 addition & 90 deletions apis/dscinitialization/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions apis/features/v1/features_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package v1

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

// FeatureTracker represents a cluster-scoped resource in the Data Science Cluster,
// specifically designed for monitoring and managing objects created via the internal Features API.
// This resource serves a crucial role in cross-namespace resource management, acting as
// an owner reference for various resources. The primary purpose of the FeatureTracker
// is to enable efficient garbage collection by Kubernetes. This is essential for
// ensuring that resources are automatically cleaned up and reclaimed when they are
// no longer required.
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
type FeatureTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec FeatureTrackerSpec `json:"spec,omitempty"`
Status FeatureTrackerStatus `json:"status,omitempty"`
}

func (s *FeatureTracker) ToOwnerReference() metav1.OwnerReference {
return metav1.OwnerReference{
APIVersion: s.APIVersion,
Kind: s.Kind,
Name: s.Name,
UID: s.UID,
}
}

// FeatureTrackerSpec defines the desired state of FeatureTracker.
type FeatureTrackerSpec struct {
}

// FeatureTrackerStatus defines the observed state of FeatureTracker.
type FeatureTrackerStatus struct {
}

// +kubebuilder:object:root=true

// FeatureTrackerList contains a list of FeatureTracker.
type FeatureTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []FeatureTracker `json:"items"`
}

func init() {
SchemeBuilder.Register(
&FeatureTracker{},
&FeatureTrackerList{},
)
}
37 changes: 37 additions & 0 deletions apis/features/v1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
Copyright 2023.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// +kubebuilder:object:generate=true
// +groupName=features.opendatahub.io

// Package v1 contains API Schema definitions for the datasciencecluster v1 API group
package v1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects.
GroupVersion = schema.GroupVersion{Group: "features.opendatahub.io", Version: "v1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
Loading

0 comments on commit 479b004

Please sign in to comment.