Skip to content

User Profile (kubeflow-user-example-com)

Interactive Diagram

새 탭 ↗
ItemValue
VersionNot applicable (community-distribution release-26.03.1 user namespace example + dev overlay)
Official docsKubeflow Profiles
Upstream sourcecommon/user-namespace/base

A Profile is the user unit of Kubeflow multi-tenancy. A single Profile CR is the declaration “prepare this namespace for this user,” and the profile-controller reconciles it into the actual namespace and permission resources. This repository uses the upstream example Profile as is, but bundles the human admin permission, the platform-api ServiceAccount, a permanent token, the serving AuthorizationPolicy, and a PodSecurity label hook needed for dev operation into the same profile directory.

The profile does not merely create a namespace. Around that namespace, the overlay also adds development conveniences and machine-access wiring that the upstream example does not include by default.

  • Profile CR: The kubeflow-user-example-com Profile. The owner is User user@example.com.
  • Profile namespace: The profile-controller creates the namespace of the same name, kubeflow-user-example-com.
  • Human admin RBAC: Binds user@example.com to cluster-admin for dev convenience.
  • platform-api M2M credential: The platform-api ServiceAccount, a non-expiring legacy token Secret, and the kubeflow-admin ClusterRoleBinding.
  • Serving predictor access: platform-api-serving-access lets platform-api pass the KServe predictor sidecar AuthorizationPolicy.
  • Profile namespace PodSecurity label: Because the Profile namespace is created asynchronously, a retrying PSS labeler Job applies the pod-security.kubernetes.io/enforce=baseline label. It carries an ArgoCD hook annotation, but in the dev manual apply it is created immediately as a normal Job.

At the Dashboard stage, the Profile CRD and controller are ready, but no actual user namespace exists yet. When this stage applies the Profile CR, the profile-controller creates the namespace, and Dashboard/KFAM can show this namespace to the user. After that, components such as Notebooks, Pipelines, KServe, and Model Registry create user workloads or per-user resources on the premise that this Profile namespace exists.

This step is where Kubeflow’s multi-tenant control plane becomes a concrete workspace for a specific user. This overlay takes Kubeflow’s abstract profile machinery and turns it into an actual, usable user workspace. It also shows the real-world additions that often surround an example profile in practice: machine credentials, serving exceptions, and post-reconcile operational fixups.

  • Materializing the user namespace: The kubeflow-user-example-com namespace is created, providing a space to receive later user workloads and namespace-scoped resources.
  • Multi-user RBAC wiring: The owner user@example.com is registered as the Profile owner, and the Profile controller creates the default RoleBindings and Istio AuthorizationPolicy.
  • Automation credential: Provides the platform-api token so that an external backend/CI can call Kubeflow APIs through the gateway.
  • Serving M2M correction: Adds a separate ALLOW policy so that the kubeflow-userid of platform-api passes the predictor sidecar authz on the KServe serving 2-hop path.
  • Prerequisite for later components: Model Registry is installed in the profile namespace kubeflow-user-example-com, so this stage must be reconciled first.

The top-level overlay is an index that collects per-profile subdirectories. When a new Profile is needed, add a directory with the same structure and put it in the resources of overlays/dev/kubeflow-profile/kustomization.yaml.

overlays/dev/kubeflow-profile
-> kubeflow-user-example-com
-> common/user-namespace/base
-> profile/postsync-pss-label.yaml
-> rbac/user-clusterrolebinding.yaml
-> platform-api/platform-api-token.yaml
-> platform-api/serving-authorizationpolicy.yaml

common/user-namespace/base contains only the Profile CR. The rest is reconciled by the profile-controller. This split is important: Git applies the intent, and the controller materializes the concrete namespace objects asynchronously.

Created byResourceName / scopeRole
Git overlayProfilekubeflow-user-example-comDeclares owner user@example.com
profile-controllerNamespacekubeflow-user-example-comUser workload namespace
profile-controllerServiceAccountdefault-editor, default-viewerDefault SAs of the user namespace
profile-controllerRoleBindingInside the namespaceBinds permissions for the owner and default SAs
profile-controllerAuthorizationPolicyns-owner-access-istio and othersOwner-based Istio access
FileResourceRole
rbac/user-clusterrolebinding.yamlClusterRoleBinding kubeflow-user-example-com-cluster-adminGrants dev cluster-admin to user@example.com
platform-api/platform-api-token.yamlServiceAccount platform-apiIdentity for API automation
platform-api/platform-api-token.yamlSecret platform-api-tokenNon-expiring legacy ServiceAccount token
platform-api/platform-api-token.yamlClusterRoleBinding platform-api-kubeflow-adminGrants platform-api admin rights on Kubeflow resources across all profiles
platform-api/serving-authorizationpolicy.yamlAuthorizationPolicy platform-api-serving-accessAllows platform-api calls at the predictor sidecar
profile/postsync-pss-label.yamlPSS labeler Job/RBACWaits for the Profile namespace, then applies the PodSecurity baseline label

The cluster-admin binding for user@example.com is explicitly a dev choice, not a production best practice. The platform-api token is intended for backend or CI use through the gateway.

KServe serving traffic has a special authorization wrinkle. The profile owner’s usual allow policy expects the interactive user’s identity, often based on email. But the platform-api ServiceAccount identifies itself as system:serviceaccount:kubeflow-user-example-com:platform-api. That identity does not match the profile owner’s email-based rule, so predictor-side authorization would reject it unless an additional allow policy exists. platform-api/serving-authorizationpolicy.yaml adds platform-api-serving-access for that reason.

Security trade-off of the platform-api credential

Section titled “Security trade-off of the platform-api credential”

The legacy token Secret itself also has problems.

  • Kubernetes 1.29+ enables LegacyServiceAccountTokenCleanUp by default, which automatically deletes legacy token Secrets that have not been used for one year. An automation credential that is not called regularly can silently disappear one day.
  • Legacy tokens issued by the kubernetes/serviceaccount issuer have no aud claim. Therefore audience validation is impossible at the gateway or sidecar, and the token can be reused as is against endpoints it was never intended for.

The recommended path is to obtain a bound token with a specified audience through the TokenRequest API. It has an expiry, it carries aud so the receiver can validate the audience, and it is bound to a target object so it is easy to revoke.

NamespaceResourceNameRole
(cluster)Profilekubeflow-user-example-comProfile declaration for owner user@example.com
(cluster)Namespacekubeflow-user-example-comUser namespace created by the profile-controller
(cluster)ClusterRoleBindingkubeflow-user-example-com-cluster-adminHuman admin permission
kubeflow-user-example-comServiceAccountplatform-apiM2M API caller
kubeflow-user-example-comSecretplatform-api-tokenLegacy SA token credential
(cluster)ClusterRoleBindingplatform-api-kubeflow-adminplatform-api rights on Kubeflow resources across all profiles
kubeflow-user-example-comAuthorizationPolicyplatform-api-serving-accessAllows KServe predictor calls
kubeflowJob + SA/RBACkubeflow-user-example-com-pss-labelerApplies the PodSecurity label after namespace creation

PlantUML source:

PlantUML Diagram

When this overlay applies Profile/kubeflow-user-example-com, the profile-controller detects it and creates the namespace of the same name and the default permissions. Because the namespace is created asynchronously, the PSS labeler Job retries while applying the PodSecurity label. In dev, this resource is applied manually as a normal Job and does not depend on the ArgoCD hook lifecycle in the annotation.

PlantUML source:

PlantUML Diagram
  • Prerequisite: 07-dashboard must be installed so that the profiles.kubeflow.org CRD and the profile-controller are ready. To use M2M calls as well, the oauth2-proxy M2M RequestAuthentication and the cluster-local-gateway-jwt legacy issuer patch must also be in place first.
  • Downstream: Notebooks, Pipelines user workloads, KServe user namespace resources, Model Registry, and any automation that uses the platform-api identity. In particular, Model Registry Pods start properly only if the kubeflow-user-example-com namespace exists first.

When the Profile CR is applied, the profile-controller creates the namespace and default permissions asynchronously. The PSS labeler Job retries until this asynchronous creation finishes and applies the PodSecurity label. An external backend sends platform-api-token as a Bearer token in the Authorization header, and the gateway RequestAuthentication maps the token’s sub to kubeflow-userid. KServe serving calls validate the JWT again at the cluster-local-gateway and then pass the platform-api-serving-access policy at the predictor sidecar.

  • Profile/kubeflow-user-example-com: The declaration that creates the user namespace. The owner is user@example.com.
  • kubeflow-user-example-com-cluster-admin: Human admin permission in the dev environment. In production, the scope of this permission should be reduced.
  • platform-api + platform-api-token: M2M credential for automation. Because it is a legacy token, it does not expire and requires secure storage and rotation.
  • platform-api-serving-access: A minimal ALLOW policy that lets a ServiceAccount subject that is not the profile owner call the KServe predictor.
  • kubeflow-user-example-com-pss-labeler: A retrying Job and minimal RBAC that correct the PodSecurity label after the asynchronous creation of the Profile namespace. Because profile namespace creation is asynchronous, post-create fixup jobs are sometimes necessary even when the base Profile resource looks simple.