User Profile (kubeflow-user-example-com)
기본 정보
섹션 제목: “기본 정보”| 항목 | 값 |
|---|---|
| version | 해당 없음 (community-distribution release-26.03.1 의 user namespace 예제 + dev overlay) |
| 공식 문서 | Kubeflow Profiles |
| upstream 소스 | common/user-namespace/base |
개념과 특징
섹션 제목: “개념과 특징”Profile은 Kubeflow multi-tenancy의 사용자 단위다. Profile CR 하나가 “이 사용자에게 이 namespace를 준비하라”는 선언이고, profile-controller가 이를 reconcile해 실제 namespace와 권한 리소스를 만든다. 이 저장소는 upstream 예제 Profile을 그대로 쓰되, dev 운영에 필요한 사람 admin 권한, platform-api ServiceAccount, 영구 token, serving AuthorizationPolicy, PodSecurity label hook을 같은 profile 디렉터리에 묶어 관리한다.
component 가 확립하는 것
섹션 제목: “component 가 확립하는 것”- Profile CR:
kubeflow-user-example-comProfile. owner는Useruser@example.com. - Profile namespace: profile-controller가 동명의
kubeflow-user-example-comnamespace를 생성한다. - 사람 admin RBAC:
user@example.com을 dev 편의상cluster-admin에 바인딩한다. - platform-api M2M credential:
platform-apiServiceAccount와 만료 없는 legacy token Secret,kubeflow-adminClusterRoleBinding. - serving predictor 접근 허용:
platform-api가 KServe predictor sidecar AuthorizationPolicy를 통과하도록platform-api-serving-access를 둔다. - Profile namespace PodSecurity label: Profile namespace가 비동기로 생기므로 retry하는 PSS labeler Job이
pod-security.kubernetes.io/enforce=baselinelabel을 붙인다. ArgoCD hook annotation이 있지만 dev의 수동 apply에서는 일반 Job으로 즉시 생성된다.
Kubeflow 에서의 역할
섹션 제목: “Kubeflow 에서의 역할”Dashboard 단계에서 Profile CRD와 controller는 준비됐지만, 실제 사용자 namespace는 아직 없다. 이 단계가 Profile CR을 apply하면 profile-controller가 namespace를 만들고, Dashboard/KFAM이 이 namespace를 사용자에게 보여 줄 수 있게 된다. 이후 Notebooks, Pipelines, KServe, Model Registry 같은 component는 이 Profile namespace가 존재한다는 전제 위에서 사용자 workload나 사용자별 리소스를 만든다.
핵심 기여
섹션 제목: “핵심 기여”- 사용자 namespace 실체화:
kubeflow-user-example-comnamespace가 생성되어, 이후 사용자 workload와 namespace-scoped 리소스를 받을 공간이 생긴다. - multi-user RBAC 연결: owner
user@example.com이 Profile owner로 등록되어, Profile controller가 기본 RoleBinding과 Istio AuthorizationPolicy를 만든다. - 자동화 credential 제공: 외부 backend/CI가 gateway를 통해 Kubeflow API를 호출할 수 있도록
platform-apitoken을 제공한다. - serving M2M 보정: KServe serving 2-hop 경로에서
platform-api의kubeflow-userid가 predictor sidecar authz를 통과하도록 별도 ALLOW 정책을 추가한다. - 후속 component 선행 조건: Model Registry는 profile namespace
kubeflow-user-example-com에 설치되므로 이 단계가 먼저 reconcile되어야 한다.
배포 구조
섹션 제목: “배포 구조”overlay 구성
섹션 제목: “overlay 구성”상위 overlay는 profile별 하위 디렉터리를 모으는 인덱스다. 새 Profile이 필요하면 같은 구조의 디렉터리를 추가하고 overlays/dev/kubeflow-profile/kustomization.yaml의 resources에 넣는다.
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.yamlprofile-controller 가 생성하는 것
섹션 제목: “profile-controller 가 생성하는 것”common/user-namespace/base에는 Profile CR만 있다. 나머지는 profile-controller가 reconcile한다.
| 생성 주체 | resource | 이름 / 범위 | 역할 |
|---|---|---|---|
| Git overlay | Profile | kubeflow-user-example-com | owner user@example.com 선언 |
| profile-controller | Namespace | kubeflow-user-example-com | 사용자 workload namespace |
| profile-controller | ServiceAccount | default-editor, default-viewer | 사용자 namespace 기본 SA |
| profile-controller | RoleBinding | namespace 내부 | owner와 기본 SA 권한 연결 |
| profile-controller | AuthorizationPolicy | ns-owner-access-istio 등 | owner 기반 Istio 접근 허용 |
이 저장소가 추가로 포함하는 것
섹션 제목: “이 저장소가 추가로 포함하는 것”| 파일 | resource | 역할 |
|---|---|---|
rbac/user-clusterrolebinding.yaml | ClusterRoleBinding kubeflow-user-example-com-cluster-admin | user@example.com에 dev cluster-admin 부여 |
platform-api/platform-api-token.yaml | ServiceAccount platform-api | API automation용 신원 |
platform-api/platform-api-token.yaml | Secret platform-api-token | 만료 없는 legacy ServiceAccount token |
platform-api/platform-api-token.yaml | ClusterRoleBinding platform-api-kubeflow-admin | platform-api에 전 profile Kubeflow resource admin 권한 부여 |
platform-api/serving-authorizationpolicy.yaml | AuthorizationPolicy platform-api-serving-access | predictor sidecar에서 platform-api 호출 허용 |
profile/postsync-pss-label.yaml | PSS labeler Job/RBAC | Profile namespace를 기다린 뒤 PodSecurity baseline label 적용 |
platform-api credential 의 보안 trade-off
섹션 제목: “platform-api credential 의 보안 trade-off”legacy token Secret 자체도 문제가 있다.
- Kubernetes 1.29+ 는
LegacyServiceAccountTokenCleanUp이 기본 활성화되어, 1년 동안 사용되지 않은 legacy token Secret을 자동으로 삭제한다. 상시 호출되지 않는 automation credential은 어느 날 조용히 사라질 수 있다. kubernetes/serviceaccountissuer 가 발급한 legacy token 에는audclaim이 없다. 따라서 gateway나 sidecar에서 audience 검증이 불가능하고, token이 원래 의도하지 않은 endpoint에 그대로 재사용될 수 있다.
권장 경로는 TokenRequest API로 audience를 지정한 bound token을 발급받는 것이다. 만료가 있고, aud가 있어 수신 측에서 audience를 검증할 수 있으며, 대상 object에 묶여 있어 회수도 쉽다.
Deployment view
섹션 제목: “Deployment view”Resource Placement
섹션 제목: “Resource Placement”| namespace | resource | 이름 | 역할 |
|---|---|---|---|
| (cluster) | Profile | kubeflow-user-example-com | owner user@example.com의 Profile 선언 |
| (cluster) | Namespace | kubeflow-user-example-com | profile-controller가 생성하는 사용자 namespace |
| (cluster) | ClusterRoleBinding | kubeflow-user-example-com-cluster-admin | 사람 admin 권한 |
kubeflow-user-example-com | ServiceAccount | platform-api | M2M API 호출 주체 |
kubeflow-user-example-com | Secret | platform-api-token | legacy SA token credential |
| (cluster) | ClusterRoleBinding | platform-api-kubeflow-admin | platform-api 전 profile Kubeflow resource 권한 |
kubeflow-user-example-com | AuthorizationPolicy | platform-api-serving-access | KServe predictor 호출 허용 |
kubeflow | Job + SA/RBAC | kubeflow-user-example-com-pss-labeler | namespace 생성 후 PodSecurity label 적용 |
Diagram
섹션 제목: “Diagram”PlantUML 원본:
동작 흐름
섹션 제목: “동작 흐름”Profile reconcile
섹션 제목: “Profile reconcile”이 overlay가 Profile/kubeflow-user-example-com을 apply하면 profile-controller가 이를 감지하고 같은 이름의 namespace와 기본 권한을 만든다. namespace는 비동기로 생성되므로 PSS labeler Job이 retry하면서 PodSecurity label을 적용한다. dev에서는 이 resource를 일반 Job으로 수동 적용하며, annotation의 ArgoCD hook lifecycle에 의존하지 않는다.
PlantUML 원본:
의존성과 상호작용
섹션 제목: “의존성과 상호작용”선행 / 후행
섹션 제목: “선행 / 후행”- 선행:
07-dashboard가 설치되어profiles.kubeflow.orgCRD와 profile-controller가 준비되어야 한다. M2M 호출까지 쓰려면oauth2-proxyM2M RequestAuthentication과cluster-local-gateway-jwtlegacy issuer patch도 선행되어야 한다. - 후행: Notebooks, Pipelines user workload, KServe user namespace 리소스, Model Registry. 특히 Model Registry는
kubeflow-user-example-comnamespace가 먼저 존재해야 Pod가 정상 기동한다.
런타임 상호작용
섹션 제목: “런타임 상호작용”Profile CR이 apply되면 profile-controller가 namespace와 기본 권한을 비동기로 만든다. PSS labeler Job은 이 비동기 생성이 끝날 때까지 retry하며 PodSecurity label을 붙인다. 외부 backend는 platform-api-token을 Authorization: Bearer로 보내고, gateway RequestAuthentication이 token의 sub를 kubeflow-userid로 매핑한다. KServe serving 호출은 cluster-local-gateway에서 다시 JWT를 검증한 뒤 predictor sidecar의 platform-api-serving-access 정책을 통과한다.
핵심 리소스
섹션 제목: “핵심 리소스”Profile/kubeflow-user-example-com: user namespace 생성의 선언. owner는user@example.com.kubeflow-user-example-com-cluster-admin: dev 환경의 사람 admin 권한. 운영에서는 권한 범위를 줄이는 것이 맞다.platform-api+platform-api-token: automation용 M2M credential. legacy token이라 만료가 없으며 안전한 보관과 rotate가 필요하다.platform-api-serving-access: profile owner가 아닌 ServiceAccount subject가 KServe predictor를 호출할 수 있게 하는 최소 ALLOW 정책.kubeflow-user-example-com-pss-labeler: Profile namespace 비동기 생성 이후 PodSecurity label을 보정하는 retry Job과 최소 RBAC.
- overlay:
overlays/dev/kubeflow-profile - profile overlay:
overlays/dev/kubeflow-profile/kubeflow-user-example-com - upstream Profile:
common/user-namespace/base - 관련 문서: