Kubeflow
- Kubeflow Charmers | bundle
- Cloud
Channel | Revision | Published |
---|---|---|
latest/candidate | 294 | 24 Jan 2022 |
latest/beta | 430 | 30 Aug 2024 |
latest/edge | 423 | 26 Jul 2024 |
1.10/stable | 436 | 07 Apr 2025 |
1.10/candidate | 434 | 02 Apr 2025 |
1.10/beta | 433 | 24 Mar 2025 |
1.9/stable | 432 | 03 Dec 2024 |
1.9/beta | 420 | 19 Jul 2024 |
1.9/edge | 431 | 03 Dec 2024 |
1.8/stable | 414 | 22 Nov 2023 |
1.8/beta | 411 | 22 Nov 2023 |
1.8/edge | 413 | 22 Nov 2023 |
1.7/stable | 409 | 27 Oct 2023 |
1.7/beta | 408 | 27 Oct 2023 |
1.7/edge | 407 | 27 Oct 2023 |
juju deploy kubeflow --channel 1.10/stable
Deploy Kubernetes operators easily with Juju, the Universal Operator Lifecycle Manager. Need a Kubernetes cluster? Install MicroK8s to create a full CNCF-certified Kubernetes system in under 60 seconds.
Platform:
This guide describes how authentication works in Charmed Kubeflow (CKF).
All CKF applications and services, including the Kubeflow central dashboard, are centrally exposed through a single ingress, which can also be configured for TLS. Since these applications can modify resources in the underlying Kubernetes (K8s) cluster, they require users to be logged in and authenticated to enable proper authorization checks.
Authentication is handled by configuring the central ingress to enforce request authentication via the OIDC flow. If a request is unauthenticated, the user is redirected to log in. This ensures that access to all CKF applications and resources is restricted to authenticated users.
Components
Authentication in CKF leverages three components:
- An Identity Provider (IdP), which stores and manages digital identities. It is implemented by the
dex-auth
charm. Also referred to as OpenID Connect (OIDC) provider. - An OIDC client, which requests tokens for authentication. It is implemented by the
oidc-gatekeeper
charm. Also referred to asAuthService
. - An ingress, which manages external access to your Kubernetes cluster’s services. It is implemented by the
istio-ingressgateway
andistio-pilot
charms, both needed to configure theistio-gateway
charm.
These three components participate in the OIDC flow:
Some important aspects to highlight:
- The Istio Gateway is configured by an EnvoyFilter, which enforces authentication by forwarding every request made to the Gateway to an AuthService (
oidc-gatekeeper
).
- The
EnvoyFilter
template is rendered and applied byistio-pilot
when integrated withoidc-gatekeeper
via theingress-auth
interface where the latter provides the following data:
service - oidc-gatekeeper
: service name to forward all ingress traffic to.port
: port of theservice - oidc-gatekeeper
.allowed-request-headers
: a list of allowed headers to configure theEnvoyFilter authorisation_request
value, which is always set to:
"allowed-request-headers": [
"cookie",
"X-Auth-Token",
],
allowed-response-headers
: a list of allowed headers to configure theEnvoyFilter authorisation_response
value, which is always set to:
"allowed-response-headers": ["kubeflow-userid"]
userID
headers are added by theAuthService
to the original request and are used later in the authorisation process.- Dex has a built-in connector that allows the creation of static users. In CKF, this is used for easy access to the dashboard and in development and testing scenarios.
Programmatic access with the ingress and AuthService
can be configured. See this guide for more details.
CKF ingress
The following diagram showcases the CKF ingress flow:
- A user request from outside the cluster is sent, targeting
component-a
. - The request is first intercepted by a
LoadBalancer
, only if set up, or theService
that is right at the edge of the Istio Service Mesh. - The request is forwarded to the
Istio Ingress Gateway
, this is theistio-ingressgateway Service
. - The request reaches the
istio-ingressgateway
Pod at the listening port, which is configured by theGateway
resource. See Gateway for more details. - The route from the
istio-ingressgateway
Pod to the desired component is configured by aVirtualService
. See VirtualService for more details.
This flow does not consider authentication and authorisation.
Some important aspects to highlight:
- A
Gateway
gets created automatically by theistio-pilot
charm. TheGateway
Custom Resource (CR) configures the traffic received by theistio-ingressgateway-xxxx
Pod with:servers.hosts
: exposed by the Gateway and re-routed to their respective hosts based on the request.- TLS: when enabled either via the integration of a TLS certificate provider charm or passing
cert
andkey
values via a Juju secret. See this guide for more details.
The Gateway template is rendered and applied by the istio-pilot
charm.
VirtualServices
are created to define a set of traffic routes to apply when a host is addressed. In the picture above, whenever a request handled by thekubeflow-gateway
containscomponent-a
in the request, it gets routed to thecomponent-a
Service
based on theVirtualService
routing rules.
A charm that requires a VirtualService
, for instance, jupyter-ui
or kfp-ui
, integrates with istio-pilot
via the ingress
interface.
The ingress interface is not the same as this ingress interface.
The requirer charm shares the following data:
prefix
: prefix-based URI to match.rewrite
: used to rewrite the prefix portion of the URI.service
: theService
used as the destination of the request.port
: the port of theService
used as the destination.
The VirtualService
template is rendered and applied by the istio-pilot
charm in the namespace where Istio is deployed. The VirtualService
always uses the kubeflow-gateway
as the spec.gateways
value. This is not configurable.
- Kubeflow utilises path-based routing for reaching inside each components APIs, so most components expect the requests to have the format
/<rewrite>/<some>/<route>
, meaning that the request should be forwarded to the component without being prefixed with anything different than what’s defined in theVirtualService
. For example:
curl -v [kubeflow.io/pipeline](http://kubeflow.io/pipelines) -H <some header>
# or from browser [kubeflow.io/pipeline](http://kubeflow.io/pipelines)
# Should be routed as
GET /pipeline/ -H <some header>
- The
istio-ingressgateway
Deployment
andService
are created by theistio-gateway
charm.