Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: KFP multi user mode PR1 - enable multi user mode without istio authorization #1342

Merged
merged 50 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
1c43da3
Add argo to stacks/generic
Bobgy Jun 11, 2020
9e9c725
Pull pipelines manifest from upstream
Bobgy Jun 11, 2020
3fa9d21
Updated kfp
Bobgy Jun 11, 2020
50f2ff5
Minio v3 manifests
Bobgy Jun 11, 2020
b2cc166
Rename minio configmap
Bobgy Jun 11, 2020
f33ea93
Add generic minio install
Bobgy Jun 12, 2020
6151fe9
Generate new test data
Bobgy Jun 12, 2020
d396143
Mysql kustomize v3 manifest - generic install
Bobgy Jun 12, 2020
2544716
Add mysql gcp pd install
Bobgy Jun 12, 2020
0a259a1
Generate test data
Bobgy Jun 12, 2020
b364e06
Pipelines kustomize v3 manifests
Bobgy Jun 12, 2020
2f59319
Add kfp ui virtual service
Bobgy Jun 12, 2020
569c640
Add metadata deployment to stacks/generic
Bobgy Jun 12, 2020
a3e5c3a
Use common cluster domain
Bobgy Jun 12, 2020
cfda2d9
Deploy metadata writer
Bobgy Jun 12, 2020
0a4770b
Add kfp cache server
Bobgy Jun 12, 2020
7907d06
Update test data
Bobgy Jun 12, 2020
400aa0b
Merge remote-tracking branch 'upstream/master' into v3_kfp
Bobgy Jun 15, 2020
d4b33b6
Enable KFP multi user mode without istio security
Bobgy Jun 15, 2020
5530b2a
Fix persistence agent watch namespace
Bobgy Jun 15, 2020
97424f1
Fix namespace env for some deployments
Bobgy Jun 16, 2020
805d6da
Fix cluster roles and bindings
Bobgy Jun 16, 2020
7c32e6f
fix rename
Bobgy Jun 16, 2020
7bddf40
Fix pipelines ui role
Bobgy Jun 16, 2020
88cc01b
Updated kfp to rc2
Bobgy Jun 17, 2020
5f92c94
simplify pipeline v3 manifest using updated kfp rc2 manifest
Bobgy Jun 17, 2020
59b8ff9
Fix pipeline-install-config
Bobgy Jun 17, 2020
72e598d
remove redundant configmap
Bobgy Jun 17, 2020
66658b9
update tests
Bobgy Jun 17, 2020
7358da0
Merge branch 'v3_kfp' into kfp_multi_user_without_istio
Bobgy Jun 17, 2020
1eb4d56
updated to kfp 1.0.0-rc.3
Bobgy Jul 3, 2020
9bc841b
Adapt to kfp 1.0rc3 refactoring
Bobgy Jul 3, 2020
e73382b
update test snapshots
Bobgy Jul 3, 2020
b7c6795
Merge branch 'kfp_rc3' into kfp_multi_user_without_istio
Bobgy Jul 3, 2020
03a63d8
fix pull kfp script to detect empty dir
Bobgy Jul 3, 2020
0df67aa
fix example ref
Bobgy Jul 3, 2020
28452a3
update snapshot
Bobgy Jul 3, 2020
4faf673
fix gcp pd manifest
Bobgy Jul 3, 2020
2b35d9e
Update stacks ref
Bobgy Jul 3, 2020
6df2abc
revert alice example to gcp stack
Bobgy Jul 3, 2020
0230d0c
update snapshot
Bobgy Jul 3, 2020
5b3d882
fix profile controller iam binding
Bobgy Jul 3, 2020
2c5f8d0
Merge remote-tracking branch 'upstream/master' into kfp_multi_user_wi…
Bobgy Jul 6, 2020
30552d1
Update kfp profile controller can be configured to different images and
Bobgy Jul 6, 2020
604e8b2
Merge remote-tracking branch 'upstream/master' into kfp_multi_user_wi…
Bobgy Jul 7, 2020
c71bf14
add missing viewer controller cluster roles
Bobgy Jul 7, 2020
4f2f96c
Use python3 for sync.py
Bobgy Jul 7, 2020
78b3eea
Revert gcp stack back to use non multi user kfp
Bobgy Jul 7, 2020
09cdd13
revert unintended changes
Bobgy Jul 7, 2020
e0baea1
revert upstream changes
Bobgy Jul 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions hack/pull_kfp_upstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ set -ex
# pipelines version.
export PIPELINES_VERSION=1.0.0-rc.3
export PIPELINES_SRC_REPO=https://github.com/kubeflow/pipelines.git
# Pulling for the first time
# kpt pkg get $PIPELINES_SRC_REPO/manifests/kustomize@$PIPELINES_VERSION pipeline/upstream

# Updates
kpt pkg update pipeline/upstream/@$PIPELINES_VERSION --strategy force-delete-replace
if [ -d pipeline/upstream ]; then
# Updates
kpt pkg update pipeline/upstream/@$PIPELINES_VERSION --strategy force-delete-replace
else
# Pulling for the first time
kpt pkg get $PIPELINES_SRC_REPO/manifests/kustomize@$PIPELINES_VERSION pipeline/upstream
fi

# Before kubeflow/pipelines/manifests/kustomize supports kustomize v3.5+, we
# have to convert kustomization.yaml env to envs syntax, so that it is compatible
# with latest kustomize used in kubeflow/manifests.
Expand Down
11 changes: 11 additions & 0 deletions pipeline/installs/multi-user/api-service/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: ml-pipeline
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ml-pipeline
subjects:
- kind: ServiceAccount
name: ml-pipeline
34 changes: 34 additions & 0 deletions pipeline/installs/multi-user/api-service/cluster-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: ml-pipeline
rules:
- apiGroups:
- argoproj.io
resources:
- workflows
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
- apiGroups:
- kubeflow.org
resources:
- scheduledworkflows
verbs:
- create
- get
- list
- update
- patch
- delete
- apiGroups:
- ""
resources:
- pods
verbs:
- delete
12 changes: 12 additions & 0 deletions pipeline/installs/multi-user/api-service/deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ml-pipeline
spec:
template:
spec:
containers:
- name: ml-pipeline-api-server
envFrom:
- configMapRef:
name: pipeline-api-server-config
8 changes: 8 additions & 0 deletions pipeline/installs/multi-user/api-service/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster-role-binding.yaml
- cluster-role.yaml
configMapGenerator:
- name: pipeline-api-server-config
env: params.env
4 changes: 4 additions & 0 deletions pipeline/installs/multi-user/api-service/params.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MULTIUSER=true
DEFAULTPIPELINERUNNERSERVICEACCOUNT=default-editor
VISUALIZATIONSERVICE_NAME=ml-pipeline-visualizationserver
VISUALIZATIONSERVICE_PORT=8888
11 changes: 11 additions & 0 deletions pipeline/installs/multi-user/cache/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubeflow-pipelines-cache-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubeflow-pipelines-cache-role
subjects:
- kind: ServiceAccount
name: kubeflow-pipelines-cache
31 changes: 31 additions & 0 deletions pipeline/installs/multi-user/cache/cluster-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubeflow-pipelines-cache-role
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- update
- patch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- apiGroups:
- argoproj.io
resources:
- workflows
verbs:
- get
- list
- watch
- update
- patch
13 changes: 13 additions & 0 deletions pipeline/installs/multi-user/cache/deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cache-server
spec:
template:
spec:
containers:
- name: server
env:
- name: NAMESPACE_TO_WATCH
value: ''
valueFrom: null
5 changes: 5 additions & 0 deletions pipeline/installs/multi-user/cache/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster-role.yaml
- cluster-role-binding.yaml
21 changes: 21 additions & 0 deletions pipeline/installs/multi-user/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kubeflow
resources:
- ../generic
- api-service
- pipelines-ui
- pipelines-profile-controller
- scheduled-workflow
- viewer-controller
- persistence-agent
- cache
- metadata-writer
patchesStrategicMerge:
- api-service/deployment-patch.yaml
- pipelines-ui/deployment-patch.yaml
- scheduled-workflow/deployment-patch.yaml
- viewer-controller/deployment-patch.yaml
- persistence-agent/deployment-patch.yaml
- metadata-writer/deployment-patch.yaml
- cache/deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubeflow-pipelines-metadata-writer-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubeflow-pipelines-metadata-writer-role
subjects:
- kind: ServiceAccount
name: kubeflow-pipelines-metadata-writer
31 changes: 31 additions & 0 deletions pipeline/installs/multi-user/metadata-writer/cluster-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubeflow-pipelines-metadata-writer-role
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- update
- patch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- apiGroups:
- argoproj.io
resources:
- workflows
verbs:
- get
- list
- watch
- update
- patch
13 changes: 13 additions & 0 deletions pipeline/installs/multi-user/metadata-writer/deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: metadata-writer
spec:
template:
spec:
containers:
- name: main
env:
- name: NAMESPACE_TO_WATCH
value: ''
valueFrom: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster-role.yaml
- cluster-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ml-pipeline-persistenceagent-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ml-pipeline-persistenceagent-role
subjects:
- kind: ServiceAccount
name: ml-pipeline-persistenceagent
21 changes: 21 additions & 0 deletions pipeline/installs/multi-user/persistence-agent/cluster-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ml-pipeline-persistenceagent-role
rules:
- apiGroups:
- argoproj.io
resources:
- workflows
verbs:
- get
- list
- watch
- apiGroups:
- kubeflow.org
resources:
- scheduledworkflows
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ml-pipeline-persistenceagent
spec:
template:
spec:
containers:
- name: ml-pipeline-persistenceagent
env:
- name: NAMESPACE
value: ''
valueFrom: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster-role.yaml
- cluster-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: metacontroller.k8s.io/v1alpha1
kind: CompositeController
metadata:
name: profile-controller
spec:
generateSelector: true
resyncPeriodSeconds: 10
parentResource:
apiVersion: v1
resource: namespaces
childResources:
- apiVersion: v1
resource: secrets
updateStrategy:
method: OnDelete
- apiVersion: v1
resource: configmaps
updateStrategy:
method: OnDelete
- apiVersion: apps/v1
resource: deployments
updateStrategy:
method: InPlace
- apiVersion: v1
resource: services
updateStrategy:
method: InPlace
- apiVersion: networking.istio.io/v1alpha3
resource: destinationrules
updateStrategy:
method: InPlace
- apiVersion: rbac.istio.io/v1alpha1
resource: serviceroles
updateStrategy:
method: InPlace
- apiVersion: rbac.istio.io/v1alpha1
resource: servicerolebindings
updateStrategy:
method: InPlace
hooks:
sync:
webhook:
url: http://kubeflow-pipelines-profile-controller/sync
Copy link
Contributor

@maganaluis maganaluis Jul 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bobgy This will likely fail on other platforms or on-prem installations, I had to point to the internal service name:

url: http://kubeflow-pipelines-profile-controller.kubeflow.svc.cluster.local:80/sync

Perhaps this can be configurable via Kustomize vars. I think of the use of the name prefix just makes it a bit harder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

is using prefix a GCP specific thing?
I thought it's kubernetes standard behavior.

let me investigate

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: profile-controller
spec:
replicas: 1
template:
metadata:
annotations:
sidecar.istio.io/inject: "false"
spec:
containers:
- name: profile-controller
image: python:3.7
command: ["python", "/hooks/sync.py"]
envFrom:
- configMapRef:
name: profile-controller-env
volumeMounts:
- name: hooks
mountPath: /hooks
ports:
- containerPort: 80
volumes:
- name: hooks
configMap:
name: profile-controller-code
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kubeflow
nameprefix: kubeflow-pipelines-
commonLabels:
app: kubeflow-pipelines-profile-controller
resources:
- service.yaml
- deployment.yaml
- composite-controller.yaml
configMapGenerator:
- name: profile-controller-code
files:
- sync.py
- name: profile-controller-env
envs:
- params.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
KFP_VERSION=1.0.0-rc.3
# TODO: make visualization server work with sidecar
DISABLE_ISTIO_SIDECAR=true
Loading