Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(service-mesh): adds service mesh authz support for Dashboard and Workbenches #605

Closed
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
2298a07
feat(service-mesh): adds service mesh support
bartoszmajsak Sep 20, 2023
0d509b6
feat: parameterizes gateway namespace for kubeflow
cam-garrison Oct 17, 2023
556d29a
remove unused SM overlay call, restore KF repo manifests
cam-garrison Oct 26, 2023
b73db55
feat(cert): self-signed cert allows wildcards
bartoszmajsak Oct 26, 2023
c7fc306
fix(bundle): regenerates the bundle after refactoring
bartoszmajsak Oct 30, 2023
d7f2a69
fix(rbac): corrects rbac for featuretracker after refactoring
bartoszmajsak Oct 30, 2023
3da5f7d
chore: moves RFC1123 logic to common
bartoszmajsak Oct 31, 2023
cb6ca7c
fix: removes NameValue overwrite option
bartoszmajsak Oct 31, 2023
8e5747e
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Oct 31, 2023
f949417
chore: reuses cluster.CreateNamespace for feature-owned ns
bartoszmajsak Oct 31, 2023
7faf4a5
chore(script): removes unused vars
bartoszmajsak Oct 31, 2023
97197ba
fix: use ns name...
bartoszmajsak Oct 31, 2023
cfdf708
fix: clearly cannot exit vim
bartoszmajsak Oct 31, 2023
713cb0d
feat: moves initializer to feature pkg
bartoszmajsak Oct 31, 2023
103993f
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 1, 2023
28e04f6
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 1, 2023
dccc530
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 2, 2023
c0e39de
chore(dsci): moves service mesh setup to its own file
bartoszmajsak Nov 2, 2023
c335c12
chore(dashboard): moves service mesh setup to its own file
bartoszmajsak Nov 2, 2023
a04e602
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 6, 2023
a43866b
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 7, 2023
e3ce5e5
chore: removes unneeded authorino name - no other provided is foresee…
bartoszmajsak Nov 7, 2023
a5e534d
feat: adds conditional enabled to fluent API
bartoszmajsak Nov 7, 2023
206f59a
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 8, 2023
4578f24
fix: apply service mesh setup after dashboard resources are created
bartoszmajsak Nov 8, 2023
5f4d5ef
fix: patches auth-provider deployment to enable istio injection
bartoszmajsak Nov 8, 2023
5cb4533
chore: moves ApplyManifest to feature.go
bartoszmajsak Nov 8, 2023
6675aa2
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 15, 2023
de84dfa
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 15, 2023
b307a2a
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 15, 2023
1baef84
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 16, 2023
05847de
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 21, 2023
b0d2ccd
fix(tmpl): restores removed ns patch
bartoszmajsak Nov 21, 2023
351fc7e
chore: prefixes features to hold component/infra name
bartoszmajsak Nov 21, 2023
9097c6d
fix: sets default secret name if not defined
bartoszmajsak Nov 21, 2023
f8e1c07
fix(crd): updates spec
bartoszmajsak Nov 21, 2023
0bd6ab9
fix: sets scc to restricted
bartoszmajsak Nov 23, 2023
fea0569
fix(config): makes rest config loader more flexible
bartoszmajsak Nov 23, 2023
7c66f84
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Nov 27, 2023
ad562f7
chore: simplifies rest config
bartoszmajsak Nov 28, 2023
c6363fb
chore: removes unused smcp template
bartoszmajsak Nov 28, 2023
16c9a17
chore: renames istio resources to use opendatahub prefix instead of odh
bartoszmajsak Nov 28, 2023
38232ee
chore: keeps repositories in the tmp dir
bartoszmajsak Dec 1, 2023
e4fda33
fix(image): merges manifests builder stages to one
bartoszmajsak Dec 1, 2023
109fecd
chore: bumps default Authorino image
bartoszmajsak Dec 1, 2023
7924666
feat(authz): reworks authconfig
bartoszmajsak Dec 1, 2023
a86f58b
add table of contents to readme (#769)
AjayJagan Nov 30, 2023
0ed30a2
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Dec 12, 2023
edf0ebc
Process SM related templates in memory (#15)
cam-garrison Dec 19, 2023
655a27c
feat: add conditions to FeatureTracker customer resource (#16)
cam-garrison Dec 22, 2023
3b303bd
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Dec 22, 2023
ac524f7
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Jan 10, 2024
74d8eb5
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Jan 11, 2024
1ed1206
fix(lint): adjusts code based on latest linter settings
bartoszmajsak Jan 11, 2024
3043c64
feat: enhances FeatureTracker with spec (#17)
cam-garrison Jan 12, 2024
cb1f013
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Feb 5, 2024
9b89a0c
fix(manifests): return walkErr immediately
bartoszmajsak Feb 5, 2024
7920590
fix: uses proper template location
bartoszmajsak Feb 5, 2024
76a0313
Merge branch 'incubation' into service-mesh-integration
bartoszmajsak Feb 5, 2024
98049d8
fix(templ): corrects metrics folder location
bartoszmajsak Feb 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ toolbox: ## Create a toolbox instance with the proper Golang and Operator SDK ve
toolbox create opendatahub-toolbox --image localhost/opendatahub-toolbox:latest

# Run tests.
TEST_SRC=./controllers/... ./tests/integration/features/...
TEST_SRC=./controllers/... ./tests/integration/...

.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
Expand Down
6 changes: 5 additions & 1 deletion apis/dscinitialization/v1/dscinitialization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ type DSCInitializationSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=2
// +optional
Monitoring Monitoring `json:"monitoring,omitempty"`
// Enable Service Mesh for Data Science Clusters
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=3
// +optional
ServiceMesh 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
80 changes: 80 additions & 0 deletions apis/dscinitialization/v1/servicemesh_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package v1

import (
operatorv1 "github.com/openshift/api/operator/v1"
)

// ServiceMeshSpec configures Service Mesh.
type ServiceMeshSpec struct {
// +kubebuilder:validation:Enum=Managed;Removed
// +kubebuilder:default=Removed
ManagementState operatorv1.ManagementState `json:"managementState,omitempty"`
// Mesh holds configuration of Service Mesh used by Opendatahub.
Mesh MeshSpec `json:"mesh,omitempty"`
// Auth holds configuration of authentication and authorization services
// used by Service Mesh in Opendatahub.
Auth AuthSpec `json:"auth,omitempty"`
}

type MeshSpec struct {
// Name is a name Service Mesh Control Plan. Defaults to "basic".
// +kubebuilder:default=basic
Name string `json:"name,omitempty"`
// Namespace is a namespace where Service Mesh is deployed. Defaults to "istio-system".
// +kubebuilder:default=istio-system
Namespace string `json:"namespace,omitempty"`
// Certificate allows to define how to use certificates for the Service Mesh communication.
Certificate CertSpec `json:"certificate,omitempty"`
}

type CertSpec struct {
// Name of the certificate to be used by Service Mesh.
// +kubebuilder:default=opendatahub-dashboard-cert
Name string `json:"name,omitempty"`
// Generate indicates if the certificate should be generated. If set to false
// it will assume certificate with the given name is made available as a secret
// in Service Mesh namespace.
// +kubebuilder:default=true
Generate bool `json:"generate,omitempty"`
}

type AuthSpec struct {
// Name of the authorization provider used for Service Mesh.
// +kubebuilder:default=authorino
Name string `json:"name,omitempty"`
// Namespace where it is deployed.
// +kubebuilder:default=auth-provider
Namespace string `json:"namespace,omitempty"`
// Authorino holds configuration of Authorino service used as external authorization provider.
Authorino AuthorinoSpec `json:"authorino,omitempty"`
}

type AuthorinoSpec struct {
// Name specifies how external authorization provider should be called.
// +kubebuilder:default=authorino-mesh-authz-provider
Name string `json:"name,omitempty"`
// Audiences is a list of the identifiers that the resource server presented
// with the token identifies as. Audience-aware token authenticators will verify
// that the token was intended for at least one of the audiences in this list.
// If no audiences are provided, the audience will default to the audience of the
// Kubernetes apiserver (kubernetes.default.svc).
// +kubebuilder:default={"https://kubernetes.default.svc"}
Audiences []string `json:"audiences,omitempty"`
// Label narrows amount of AuthConfigs to process by Authorino service.
// +kubebuilder:default=authorino/topic=odh
Label string `json:"label,omitempty"`
// Image allows to define a custom container image to be used when deploying Authorino's instance.
// +kubebuilder:default="quay.io/kuadrant/authorino:v0.13.0"
Image string `json:"image,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really sure what this image is here for.

Copy link
Contributor Author

@bartoszmajsak bartoszmajsak Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps more a DevFlag thing in the retrospect. Up for discussion. This new part of the spec is a slimmed version of #515

}

// TODO move logic to sth like management state
// IsValid returns true if the spec is a valid and complete.
// If invalid it provides message with the reasons.
func (s *ServiceMeshSpec) IsValid() (bool, string) {
if s.Auth.Name != "authorino" {
return false, "currently only Authorino is available as authorization layer"
}

return true, ""
}
87 changes: 86 additions & 1 deletion apis/dscinitialization/v1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,96 @@ spec:
description: Namespace for monitoring if it is enabled
type: string
type: object
serviceMesh:
description: Enable Service Mesh for Data Science Clusters
properties:
auth:
description: Auth holds configuration of authentication and authorization
services used by Service Mesh in Opendatahub.
properties:
authorino:
description: Authorino holds configuration of Authorino service
used as external authorization provider.
properties:
audiences:
default:
- https://kubernetes.default.svc
description: Audiences is a list of the identifiers that
the resource server presented with the token identifies
as. Audience-aware token authenticators will verify
that the token was intended for at least one of the
audiences in this list. If no audiences are provided,
the audience will default to the audience of the Kubernetes
apiserver (kubernetes.default.svc).
items:
type: string
type: array
image:
default: quay.io/kuadrant/authorino:v0.13.0
description: Image allows to define a custom container
image to be used when deploying Authorino's instance.
type: string
label:
default: authorino/topic=odh
description: Label narrows amount of AuthConfigs to process
by Authorino service.
type: string
name:
default: authorino-mesh-authz-provider
description: Name specifies how external authorization
provider should be called.
type: string
type: object
name:
default: authorino
description: Name of the authorization provider used for Service
Mesh.
type: string
namespace:
default: auth-provider
description: Namespace where it is deployed.
type: string
type: object
managementState:
default: Removed
enum:
- Managed
- Removed
pattern: ^(Managed|Unmanaged|Force|Removed)$
type: string
mesh:
description: Mesh holds configuration of Service Mesh used by
Opendatahub.
properties:
certificate:
description: Certificate allows to define how to use certificates
for the Service Mesh communication.
properties:
generate:
default: true
description: Generate indicates if the certificate should
be generated. If set to false it will assume certificate
with the given name is made available as a secret in
Service Mesh namespace.
type: boolean
name:
default: opendatahub-dashboard-cert
description: Name of the certificate to be used by Service
Mesh.
type: string
type: object
name:
default: basic
description: Name is a name Service Mesh Control Plan. Defaults
to "basic".
type: string
namespace:
default: istio-system
description: Namespace is a namespace where Service Mesh is
deployed. Defaults to "istio-system".
type: string
type: object
type: object
required:
- applicationsNamespace
type: object
Expand Down
Loading
Loading