Kubeflow Pipelines
기본 정보
섹션 제목: “기본 정보”| 항목 | 값 |
|---|---|
| version | Kubeflow Pipelines v2.16.1 |
| 공식 문서 | Kubeflow Pipelines |
| upstream 소스 | applications/pipeline/upstream |
개념과 특징
섹션 제목: “개념과 특징”Kubeflow Pipelines는 ML workflow를 Pipeline, PipelineVersion, Run, ScheduledWorkflow 같은 API로 관리하고, 실제 실행은 Argo Workflow로 구체화한다. 사용자는 Dashboard의 /pipeline UI나 KFP SDK/API를 통해 Run을 만들고, KFP API server가 Profile namespace에 Argo Workflow를 생성한다. Workflow Pod는 step container와 KFP launcher를 실행하며 artifact는 SeaweedFS S3 호환 storage에 저장하고 실행 metadata는 ML Metadata와 KFP DB에 기록한다.
이 배포는 platform-agnostic-multi-user-k8s-native overlay를 사용한다. 따라서 KFP API server는 --pipelinesStoreKubernetes=true로 실행되고, Pipeline/PipelineVersion CRD와 webhook을 사용해 pipeline 정의를 Kubernetes resource로 관리한다.
Kubernetes native store는 Pipeline과 PipelineVersion 정의의 저장 위치를 바꾸는 기능이다.
Run, Experiment, recurring run, task 상태 같은 KFP API state와 MLMD metadata까지 DB 없이
동작한다는 뜻은 아니다. 이 배포에서 KFP API state는 공유 MySQL의 mlpipeline,
execution cache는 cachedb, MLMD metadata는 metadb에 저장한다.
component 가 확립하는 것
섹션 제목: “component 가 확립하는 것”- KFP API/UI:
ml-pipelineAPI server와ml-pipeline-uifrontend를 설치하고 Dashboard의/pipelinepath로 노출한다. - Pipeline CRD와 webhook:
pipelines.pipelines.kubeflow.org,pipelineversions.pipelines.kubeflow.orgCRD와 PipelineVersion mutating/validating webhook을 제공한다. - Workflow runtime: Argo
workflow-controller와 Workflow CRD를 설치해 Pipeline Run을 Profile namespace의 Argo Workflow로 실행한다. - metadata와 artifact backend: 공유 MySQL의
mlpipeline,cachedb,metadbdatabase가 KFP API, cache, MLMD metadata를 저장하고, SeaweedFS는 S3 호환 artifact storage를 제공한다. - multi-user namespace sync: Metacontroller
DecoratorController가 Profile namespace label을 watch하고 namespace별 KFP ConfigMap/Secret을 생성한다. - cache와 viewer:
cache-server,ml-pipeline-viewer-crd,ml-pipeline-visualizationserver가 cache hit 처리와 artifact/viewer 표시를 담당한다.
KFP와 Argo의 책임 분리
섹션 제목: “KFP와 Argo의 책임 분리”| 계층 | 담당 | 대표 resource |
|---|---|---|
| Kubeflow Pipelines | Pipeline API, Run 생성, UI, scheduling, persistence, cache, metadata write | ml-pipeline, ml-pipeline-ui, ml-pipeline-persistenceagent, ml-pipeline-scheduledworkflow, cache-server |
| Argo Workflows | 실제 DAG 실행, step Pod 생성, workflow 상태 관리, artifact repository 사용 | workflow-controller, Workflow, workflow-controller-configmap |
| Storage backend | pipeline DB, MLMD DB, execution cache, artifact object 저장 | 공유 Percona MySQL, metadata-grpc-deployment, seaweedfs |
| Profile namespace sync | namespace별 artifact credential과 launcher 설정 생성 | kubeflow-pipelines-profile-controller, kfp-launcher, artifact-repositories, mlpipeline-minio-artifact |
사용자가 보는 API는 KFP지만, 실제 step 실행은 Argo Workflow가 담당한다. KFP API server가 Run을 받고 Workflow manifest를 만들면, Argo controller가 해당 namespace에서 Pod를 만들고 artifact repository 설정에 따라 SeaweedFS에 결과물을 기록한다.
Kubeflow 에서의 역할
섹션 제목: “Kubeflow 에서의 역할”Kubeflow에서 학습 workflow를 반복 실행하려면 Notebook 안의 일회성 script만으로는 부족하다. pipeline 정의 versioning, 실험/실행 이력, step별 artifact, metadata, 재실행, scheduling, cache가 필요하다. Pipelines는 이 기능을 Kubeflow의 Profile namespace와 RBAC 안으로 가져온다.
핵심 기여
섹션 제목: “핵심 기여”- 학습 workflow 실행 표준화: KFP SDK나 UI에서 만든 Pipeline Run을 Kubernetes native resource와 Argo Workflow로 실행한다.
- Profile namespace 격리: 사용자의 Run과 artifact credential은 Profile namespace 단위로 나뉘고,
kubeflow-pipelines-edit/view권한이 Kubeflow aggregated RBAC에 합쳐진다. - artifact와 metadata 추적: step output artifact는 SeaweedFS에 저장되고, execution metadata는 MLMD와 KFP DB에 기록되어 UI에서 조회된다.
- Dashboard 통합: Central Dashboard의 Pipelines 메뉴가
/pipelinepath로ml-pipeline-ui에 연결된다. - 반복 실행과 cache: ScheduledWorkflow controller와 cache-server가 주기 실행, cache reuse, cached step mutation을 처리한다.
배포 구조
섹션 제목: “배포 구조”overlay 구성
섹션 제목: “overlay 구성”dev overlay는 upstream KFP multi-user overlay를 참조하되, upstream MySQL과 bundled SeaweedFS workload를 제거한다. KFP API, cache-server, MLMD는 mysql ExternalName Service를 통해 공유 Percona MySQL을 사용하고, artifact traffic은 seaweedfs ExternalName Service를 통해 seaweedfs namespace의 S3 gateway로 보낸다.
overlays/dev/kubeflow/overlays/pipeline -> applications/pipeline/upstream/env/cert-manager/platform-agnostic-multi-user-k8s-native -> base/crds -> env/platform-agnostic-multi-user -> base/webhook -> env/cert-manager/base-webhook-certs
applications/pipeline/upstream/env/platform-agnostic-multi-user -> third-party/metacontroller/base -> base/installs/multi-user -> base/metadata/base + metadata/options/istio -> third-party/argo/installs/cluster -> third-party/seaweedfs/istio
overlay patch/resource -> upstream mysql Deployment/PVC 제거 -> mysql Service -> ps-db-haproxy.mysql.svc.cluster.local -> ml-pipeline -> mysql/mlpipeline -> metadata-grpc -> mysql/metadb -> cache-server -> mysql/cachedb -> bundled seaweedfs Deployment/PVC/정책과 기본 credential 제거 -> seaweedfs Service -> seaweedfs-s3.seaweedfs.svc.cluster.local중요 Config
섹션 제목: “중요 Config”| 항목 | 값 / 동작 | 의미 |
|---|---|---|
| KFP mode | --pipelinesStoreKubernetes=true | Pipeline/PipelineVersion을 Kubernetes resource로 저장 |
| KFP version | 2.16.1 | API server, UI, persistence agent, scheduled workflow, viewer, visualization image tag |
| Argo Workflows | workflow-controller:v3.7.3 | Pipeline Run의 실제 Workflow 실행 runtime |
| Metacontroller | v4.11.22 | Profile namespace별 KFP attachment 생성 |
| KFP API DB | 공유 MySQL mlpipeline | ml-pipeline의 Run, Experiment, Job 등 API 상태 저장 |
| MLMD DB | 공유 MySQL metadb | metadata-grpc-deployment의 execution metadata 저장 |
| cache DB | 공유 MySQL cachedb | execution cache 저장 |
| SeaweedFS | chrislusf/seaweedfs:4.00 | S3 호환 artifact storage |
| artifact bucket | mlpipeline | Pipeline artifact 기본 bucket |
| default pipeline root | minio://mlpipeline/private-artifacts/<namespace>/v2/artifacts | Profile namespace별 기본 artifact root |
| UI route | /pipeline | Kubeflow gateway에서 Pipelines UI로 routing |
| user header | kubeflow-userid | UI/API가 Kubeflow 사용자 식별에 사용하는 header |
minio:// scheme 과 SeaweedFS
섹션 제목: “minio:// scheme 과 SeaweedFS”storage backend는 SeaweedFS인데 pipeline root URI가 minio:// 로 시작하는 것은 오타나 잔재가 아니다. minio:// 는 KFP launcher가 쓰는 S3 호환 protocol handle일 뿐이고, MinIO deployment가 따로 있다는 뜻이 아니다. launcher는 이 scheme을 보고 S3 호환 client를 선택하며, 실제 endpoint와 credential은 URI가 아니라 설정에서 가져온다.
- namespace의
kfp-launcherConfigMapdefaultPipelineRoot가 기본 root URI를 정한다. - Argo step의 artifact 업로드/다운로드 endpoint, bucket, key format, credential Secret은 namespace별
artifact-repositoriesconfig가 결정한다.
따라서 minio:// 로 시작하는 root가 가리키는 실제 목적지는 이 저장소에서 seaweedfs alias Service를 통한 SeaweedFS S3 gateway이며, 별도의 MinIO 설치는 존재하지 않는다.
shared MySQL 설정
섹션 제목: “shared MySQL 설정”KFP 2.16.1의 official API server, cache-server, MLMD 1.14.0은 모두 MySQL 경로를 지원한다.
현재 overlay는 upstream의 MySQL env contract를 유지하고 pipeline-install-config-mysql.yaml에서
host와 database만 shared MySQL 기준으로 고정한다.
dbType, cache driver는mysql이다.dbHost,mysqlHost는 namespace-local alias인mysql이다.mysqlService는ps-db-haproxy.mysql.svc.cluster.local을 가리킨다.mysql-secret의username,password를 세 workload가 공유한다.- KFP application role은
mlpipeline,cachedb,metadb에 필요한 권한을 가져야 한다.
upstream in-cluster MySQL Deployment, PVC, ServiceAccount는 제거한다. API server는 official
ghcr.io/kubeflow/kfp-api-server:2.16.1을 사용하며 PostgreSQL custom image와 PR 전용 CRD
patch는 활성 kustomization에서 제외한다.
PipelineVersion mutating/validating webhook은 ml-pipeline:8443의 application TLS endpoint다.
Kubernetes API server 요청에는 Istio workload principal이 없어서 sidecar AuthorizationPolicy가
rbac_access_denied_matched_policy[none]으로 차단한다. 그래서 ml-pipeline Pod의 8443 inbound
port만 sidecar interception에서 제외한다. webhook certificate와 caBundle 검증은 그대로
유지되며 8887, 8888 traffic은 계속 Istio sidecar를 통과한다. control-plane source IP가
cluster마다 다르므로 ml-pipeline-webhook NetworkPolicy는 8443/TCP만 별도로 허용한다.
shared MySQL 적용 후 최소 다음 기능을 실제 cluster에서 모두 통과해야 한다.
- Pipeline upload와 PipelineVersion create/list
- Experiment create/list
- Run create/list/detail과 완료 상태 persistence
- recurring run 생성과 ScheduledWorkflow 처리
- Pod restart 후 API state 유지
Multi-user Kubernetes native variant의 bundled sample Pipeline은 namespace 없이 등록되므로
A namespace is required warning이 발생한다. sample은 control plane 필수 기능이 아니므로 현재
overlay는 API server의 --sampleconfig=/config/sample_config.json argument를 제거한다. 이
변경은 사용자가 UI, SDK 또는 GitOps로 등록하는 Pipeline에는 영향을 주지 않는다.
MLMD는 mysql_config_* argument로 metadb에 연결하고 schema upgrade를 수행한다. cache-server는
같은 endpoint의 cachedb를 사용한다. 따라서 execution, context, artifact write/read와 cache hit를
실제 Run으로 함께 검증해야 한다.
webhook과 certificate
섹션 제목: “webhook과 certificate”platform-agnostic-multi-user-k8s-native overlay는 PipelineVersion mutating/validating webhook을 ml-pipeline API server에 붙인다. cert-manager annotation은 kubeflow/kfp-api-webhook-cert에서 caBundle을 주입한다. cache webhook은 cache-webhook-kubeflow MutatingWebhookConfiguration으로 Pod CREATE 요청 중 pipelines.kubeflow.org/cache_enabled: "true" label이 있는 Pod만 대상으로 하며, failurePolicy: Ignore로 설정되어 cache webhook 장애가 Pod 생성을 막지 않게 한다.
Deployment view
섹션 제목: “Deployment view”Resource Placement
섹션 제목: “Resource Placement”| namespace | resource | 이름 | 역할 |
|---|---|---|---|
kubeflow | Deployment + Service | ml-pipeline | KFP API server, Run/Pipeline API, PipelineVersion webhook backend |
kubeflow | Deployment + Service | ml-pipeline-ui | /pipeline UI frontend |
kubeflow | Deployment | ml-pipeline-persistenceagent | Workflow 상태를 KFP Run 상태로 반영 |
kubeflow | Deployment | ml-pipeline-scheduledworkflow | recurring run과 ScheduledWorkflow 처리 |
kubeflow | Deployment + Service | cache-server | KFP step cache 조회와 cache Pod mutation |
kubeflow | ExternalName Service | mysql | mysql namespace의 Percona HAProxy writer DNS alias |
kubeflow | Deployment | ml-pipeline-viewer-crd | Viewer CRD 기반 artifact viewer 생성 |
kubeflow | Deployment + Service | ml-pipeline-visualizationserver | visualization artifact rendering |
kubeflow | Deployment | metadata-writer | pipeline metadata write helper |
kubeflow | Deployment + Service | metadata-grpc-deployment, metadata-envoy-deployment | ML Metadata gRPC endpoint와 envoy |
kubeflow | Deployment + Service | workflow-controller | Argo Workflow reconcile과 Pod 생성 |
mysql | Percona MySQL Cluster + Service | ps-db, ps-db-haproxy | mlpipeline, cachedb, metadb 제공 |
kubeflow | ExternalName Service | seaweedfs | seaweedfs-s3.seaweedfs.svc.cluster.local의 DNS alias |
seaweedfs | StatefulSet | seaweedfs-master, seaweedfs-volume, seaweedfs-filer | volume topology, object chunk, filer metadata service |
seaweedfs | Deployment + Service | seaweedfs-s3 | 8333과 KFP 호환 9000을 제공하는 S3 gateway |
kubeflow | Deployment + Service | metacontroller, kubeflow-pipelines-profile-controller | Profile namespace attachment reconcile |
kubeflow | VirtualService | ml-pipeline-ui | kubeflow-gateway의 /pipeline routing |
kubeflow | AuthorizationPolicy | ml-pipeline-ui, ml-pipeline, ml-pipeline-visualizationserver, service-cache-server | UI/API/cache/visualization 접근 허용 |
| Profile namespace | ConfigMap | kfp-launcher, metadata-grpc-configmap, artifact-repositories | launcher, MLMD endpoint, artifact repository 설정 |
| Profile namespace | Secret | mlpipeline-minio-artifact | namespace별 SeaweedFS access key와 secret key |
| (cluster) | CRD | pipelines.pipelines.kubeflow.org, pipelineversions.pipelines.kubeflow.org | Kubernetes native Pipeline/PipelineVersion API |
| (cluster) | CRD | workflows.argoproj.io, scheduledworkflows.kubeflow.org, viewers.kubeflow.org | 실행 runtime, scheduled run, viewer API |
| (cluster) | ClusterRole | kubeflow-pipelines-edit, kubeflow-pipelines-view | Kubeflow aggregated RBAC에 합쳐지는 Pipeline 권한 |
Diagram
섹션 제목: “Diagram”PlantUML 원본:
동작 흐름
섹션 제목: “동작 흐름”Pipeline Run 생성과 실행
섹션 제목: “Pipeline Run 생성과 실행”사용자가 UI나 KFP SDK로 Run을 만들면 ml-pipeline API server가 Pipeline spec과 run parameter를 해석해 Profile namespace에 Argo Workflow를 생성한다. workflow-controller는 Workflow를 reconcile해 step Pod를 만들고, 각 Pod의 KFP launcher가 user container 실행, artifact upload, metadata 기록을 처리한다. ml-pipeline-persistenceagent는 Workflow 상태를 읽어 KFP Run 상태를 갱신하고 UI는 이를 조회한다.
PlantUML 원본:
Profile namespace 동기화
섹션 제목: “Profile namespace 동기화”Profile controller가 만든 namespace에는 pipelines.kubeflow.org/enabled: "true" label이 붙는다. KFP의 kubeflow-pipelines-profile-controller DecoratorController는 이 label을 가진 namespace를 watch하고, namespace별 kfp-launcher, metadata-grpc-configmap, artifact-repositories, mlpipeline-minio-artifact를 생성하도록 설계되어 있다. artifact proxy가 비활성화된 현재 설정에서는 namespace 안에 ml-pipeline-ui-artifact Deployment/Service는 만들지 않는다.
이 sync 단계에는 전제 조건이 하나 있다. profile controller의 sync hook은 namespace마다 별도의 S3 access key를 발급받기 위해 SeaweedFS IAM endpoint를 필요로 한다. 이 endpoint가 제공되지 않으면 namespace별 artifact credential Secret인 mlpipeline-minio-artifact 가 자동으로 생성되지 않고, 해당 namespace의 artifact 업로드 경로도 완성되지 않는다. 공유 object storage를 쓰는 구성에서는 IAM endpoint 제공 여부를 Pipelines 설치 전에 확인해야 한다.
PlantUML 원본:
Cache webhook 처리
섹션 제목: “Cache webhook 처리”KFP가 cache 대상 step Pod에 pipelines.kubeflow.org/cache_enabled: "true" label을 붙이면 Kubernetes admission 단계에서 cache-webhook-kubeflow가 cache-server의 /mutate endpoint를 호출한다. cache-server는 공유 MySQL의 cachedb를 조회한다. cache hit이면 Pod spec이 cached result를 사용하는 형태로 변형되고, cache miss나 webhook 장애가 있으면 일반 step Pod로 실행된다. failurePolicy: Ignore라서 cache webhook 장애는 workflow 실행 실패로 바로 이어지지 않는다.
PlantUML 원본:
의존성과 상호작용
섹션 제목: “의존성과 상호작용”선행 / 후행
섹션 제목: “선행 / 후행”- 선행:
namespace, cert-manager, Istio,kubeflow-gateway, oauth2-proxy/ExtAuthZ, Dashboard, Profile controller, Kubeflow aggregated RBAC. - 후행: Katib, Notebooks, Trainer가 개념적으로 Pipeline 실행과 연결될 수 있다. 다만 대부분은 설치 순서상 Pipelines에 강하게 묶인 필수 의존성은 아니다.
- 같이 봐야 하는 문서: 사용자 namespace와 권한은 멀티테넌시, Profile namespace 생성은 User Profile, Dashboard path와 auth 흐름은 Dashboard와 인증 흐름에서 다룬다.
런타임 상호작용
섹션 제목: “런타임 상호작용”Dashboard 사용자는 /pipeline으로 들어와 ml-pipeline-ui를 사용하고, UI는 kubeflow-userid header를 기준으로 API server에 요청한다. ml-pipeline-ui AuthorizationPolicy는 istio-ingressgateway principal을 허용한다.
ml-pipeline AuthorizationPolicy는 조금 더 조심해서 읽어야 한다. 이 정책은 “kubeflow-userid header가 없는 내부 요청을 통과시키는” 것이 아니라, 허용된 principal 목록에 속한 호출자만 통과시키고, 그중에서도 client가 스스로 kubeflow-userid 를 넣은 요청은 배제하는 anti-spoofing 규칙이다. kubeflow-userid 는 gateway가 인증 결과로 붙여야 하는 header이므로, mesh 내부에서 임의 workload가 직접 이 header를 설정해 다른 사용자를 사칭하는 경로를 막는다.
rules: - from: - source: principals: - cluster.local/ns/istio-system/sa/istio-ingressgateway-service-account - cluster.local/ns/kubeflow/sa/ml-pipeline - cluster.local/ns/kubeflow/sa/ml-pipeline-ui - cluster.local/ns/kubeflow/sa/ml-pipeline-persistenceagent - cluster.local/ns/kubeflow/sa/ml-pipeline-scheduledworkflow - cluster.local/ns/kubeflow/sa/ml-pipeline-viewer-crd-service-account when: - key: request.headers[kubeflow-userid] notValues: ["*"]즉 from.source.principals 로 ingressgateway와 KFP 내부 ServiceAccount만 신뢰하고, when 절의 request.headers[kubeflow-userid] notValues: ["*"] 조건으로 해당 header가 이미 붙어 있는 요청은 거부한다. 사용자 신원이 필요한 요청은 gateway 경로를 거쳐 들어와야 한다.
Pipeline step은 Profile namespace에서 실행되지만 control plane은 kubeflow namespace에 있다. 그래서 namespace별 artifact-repositories ConfigMap과 mlpipeline-minio-artifact Secret이 반드시 필요하다. 이 resource가 없으면 Workflow가 artifact repository credential을 찾지 못하거나 artifact upload/read가 실패한다.
현재 S3 gateway는 seaweedfs namespace의 ClusterIP Service로 열리고 별도 NetworkPolicy는 render되지 않는다. multi-user 격리는 namespace별 S3 access key와 prefix policy에 의존한다. 그래서 shared object storage에는 profile controller가 access key와 policy를 발급할 수 있는 IAM endpoint가 준비되어 있어야 한다. 상세는 공용 데이터 서비스(MySQL·Object Storage)를 참고한다.
핵심 리소스
섹션 제목: “핵심 리소스”ml-pipeline: KFP API server. Pipeline/Run API, Kubernetes native pipeline store, PipelineVersion webhook backend를 담당한다.ml-pipeline-ui: Dashboard의/pipelineUI. user header와 KFP API를 사용해 Pipeline, Run, artifact를 조회한다.workflow-controller: Argo Workflow controller. Profile namespace에 생성된 Workflow를 step Pod로 실행한다.kubeflow-pipelines-profile-controller: Metacontroller hook. Profile namespace별 KFP ConfigMap/Secret을 생성한다.artifact-repositories: Argo가 사용할 namespace별 artifact repository 설정. SeaweedFS endpoint, bucket, keyFormat, Secret reference를 담는다.kfp-launcher: KFP launcher가 사용하는 namespace별 기본 pipeline root와 cluster domain 설정.mlpipeline-minio-artifact: namespace별 SeaweedFS credential Secret.seaweedfs:seaweedfs-s3.seaweedfs.svc.cluster.local을 가리키는 ExternalName Service. KFP의 기존 8333/9000 hostname contract를 유지한다.pipeline-install-config: DB host, bucket, cache, artifact retention, defaultPipelineRoot 같은 KFP 설치 설정.cache-webhook-kubeflow: cache 대상 Pod 생성 시cache-server로 mutation을 위임하는 admission webhook.mysql: Perconaps-db-haproxywriter를 가리키는 ExternalName Service. KFP API, cache-server, MLMD가 공유한다.kubeflow-pipelines-edit/view: Kubeflow user-facing role에 합쳐지는 Pipeline/Run/Workflow 권한.
- overlay:
overlays/dev/kubeflow/overlays/pipeline - upstream:
applications/pipeline/upstream/env/cert-manager/platform-agnostic-multi-user-k8s-native - upstream:
applications/pipeline/upstream/base/installs/multi-user - 관련 문서:
추가 configuration 예시
섹션 제목: “추가 configuration 예시”다음 예시는 Pipeline deployment가 사용하는 configuration contract를 함께 문서화한다.
overlays/dev/kubeflow/overlays/pipeline -> applications/pipeline/upstream/env/cert-manager/platform-agnostic-multi-user-k8s-native -> base/crds -> env/platform-agnostic-multi-user -> base/webhook -> env/cert-manager/base-webhook-certs
applications/pipeline/upstream/env/platform-agnostic-multi-user -> third-party/metacontroller/base -> base/installs/multi-user -> base/metadata/base + metadata/options/istio -> third-party/argo/installs/cluster -> third-party/seaweedfs/istio
overlay patch/resource -> remove upstream mysql Deployment/PVC -> change mysql Service into shared Percona alias -> configure ml-pipeline for database mlpipeline -> configure metadata-grpc for database metadb -> configure cache-server for database cachedb -> remove bundled seaweedfs Deployment/PVC/policies and default credentials -> change seaweedfs Service into alias for seaweedfs-s3.seaweedfs.svc.cluster.localseaweedfs-s3.seaweedfs.svc.cluster.local