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: bump kfam and controller images to 1.8.0-rc.2 #155

Merged
merged 4 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ resources:
type: oci-image
description: Profile controller image
auto-fetch: true
upstream-source: docker.io/kubeflownotebookswg/profile-controller:v1.8.0-rc.0
upstream-source: docker.io/kubeflownotebookswg/profile-controller:v1.8.0-rc.2
kfam-image:
type: oci-image
description: Access Management image
auto-fetch: true
upstream-source: docker.io/kubeflownotebookswg/kfam:v1.8.0-rc.0
upstream-source: docker.io/kubeflownotebookswg/kfam:v1.8.0-rc.2
provides:
kubeflow-profiles:
interface: k8s-service
Expand Down
28 changes: 28 additions & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ def __init__(self, *args):
self._lightkube_field_manager = "lightkube"
self._k8s_resource_handler = None

# service account names are hardcoded
# TODO: implement relation and get from relation data
# tracked in https://github.com/canonical/kubeflow-profiles-operator/issues/156
self._istio_gateway_principal = (
"cluster.local/ns/kubeflow/sa/istio-ingressgateway-workload-service-account"
)
self._notebook_controller_principal = "cluster.local/ns/kubeflow/sa/jupyter-controller"
self._kfp_ui_principal = "cluster.local/ns/kubeflow/sa/kfp-ui"

# setup events to be handled by specific event handlers
self.framework.observe(self.on.install, self._on_install)
self.framework.observe(self.on.remove, self._on_remove)
Expand Down Expand Up @@ -98,6 +107,23 @@ def _context(self):
context = {"app_name": self.model.app.name, "model_name": self.model.name}
return context

@property
def _profiles_service_environment(self):
"""Return environment variables for kubeflow-profiles container."""
return {
"ISTIO_INGRESS_GATEWAY_PRINCIPAL": self._istio_gateway_principal, # noqa E501
"NOTEBOOK_CONTROLLER_PRINCIPAL": self._notebook_controller_principal,
"KFP_UI_PRINCIPAL": self._kfp_ui_principal,
}

@property
def _kfam_service_environment(self):
"""Return environment variables for kubeflow-kfam container."""
return {
"ISTIO_INGRESS_GATEWAY_PRINCIPAL": self._istio_gateway_principal, # noqa E501
"KFP_UI_PRINCIPAL": self._kfp_ui_principal,
}

@property
def k8s_resource_handler(self):
"""Update K8S with K8S resources."""
Expand Down Expand Up @@ -128,6 +154,7 @@ def _profiles_pebble_layer(self) -> Layer:
"command": (
"/manager " "-userid-header " "kubeflow-userid " "-userid-prefix " '""'
),
"environment": self._profiles_service_environment,
"startup": "enabled",
}
},
Expand Down Expand Up @@ -159,6 +186,7 @@ def _kfam_pebble_layer(self) -> Layer:
"-userid-prefix "
'""'
),
"environment": self._kfam_service_environment,
"startup": "enabled",
}
},
Expand Down
Loading