Skip to content

Commit

Permalink
feat: bump kfam and controller images to 1.8.0-rc.2 (#155)
Browse files Browse the repository at this point in the history
* feat: bump kfam and controller images to 1.8.0-rc.2
* fix: closes canonical/notebook-operators#309
  • Loading branch information
NohaIhab authored Oct 25, 2023
1 parent 9b228e7 commit b6c9f1d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
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

0 comments on commit b6c9f1d

Please sign in to comment.