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

kustomize kf pipeline #1305

Merged
merged 7 commits into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 41 additions & 0 deletions manifests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# TL;DR
If you want to skip any customization, you can deploy Kubeflow Pipelines by running
```
export PIPELINE_VERSION=0.1.20
kubectl create -f https://raw.githubusercontent.com/kubeflow/pipelines/$PIPELINE_VERSION/manifests/namespaced-install.yaml
```

You might lack the permission to create role and command might partially fail. If so, bind your account as cluster admin.
(Or role creator in your namespace)
```
kubectl create clusterrolebinding your-binding --clusterrole=cluster-admin --user=[your-user-name]
```

# Customization

Choose a reason for hiding this comment

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

Is there any other customization that user want to perform other than namespace?
If there is, I suggest to add instructions as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm plan to add it incrementally. want to use this PR as a good baseline.
does that sounds good?

Choose a reason for hiding this comment

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

sounds good to me. Feel free to ping me when you add more customization.

Customization can be done through Kustomize Overlay, and don't need to modify the base directory.

## Change deploy namespace

Choose a reason for hiding this comment

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

Let's keep the base unchanged. It is recommend to create overlays and add customization in the overlay.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK I'd picture the base/ dir to be unchanged, and people add overlay if needed. regarding this comment, do you just want me to call this out, or something else i need to do?

Choose a reason for hiding this comment

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

Call this out and explain that with all customization in the overlay, it is easy to understand what has been changed.

This directory contains the Kustomize Manifest for deploying Kubeflow Pipelines.
Kustomize allows you to easily customize your deployment.

To deploy Kubeflow Pipelines in namespace FOO
- Edit [kustomization.yaml](namespaced-install/kustomization.yaml) namespace section to FOO
- Then run
```
kubectl kustomize . | kubectl apply -f -
```

## Reinstall with existing data
TODO


# Uninstall
You can uninstall everything by running
```
kubectl delete -f https://raw.githubusercontent.com/kubeflow/pipelines/$PIPELINE_VERSION/manifests/namespaced-install.yaml
```

Or if you deploy using kustomize
```
kubectl kustomize . | kubectl delete -f -

Choose a reason for hiding this comment

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

Similarly, here you have multiple choices
kubectl kustomize . | kubectl delete -f -
or
kubectl delete -k -
or (with kustomize installed)
kustomize build . | kubectl delete -f -

Copy link
Member Author

Choose a reason for hiding this comment

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

great good to know. i'll keep it in mirror to the command above, to make it easy to understand.

```
9 changes: 9 additions & 0 deletions manifests/base/argo/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- workflow-controller-configmap.yaml
- workflow-controller-deployment.yaml
- workflow-controller-role.yaml
- workflow-controller-rolebinding.yaml
- workflow-controller-sa.yaml
26 changes: 26 additions & 0 deletions manifests/base/argo/workflow-controller-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: ConfigMap

Choose a reason for hiding this comment

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

We have configMapGenerator and secretGenerator which can the pods auto pick up the latest configmaps or secrets if they have changed. You can read more info here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the doc. It looks great. Based on the doc it seems gen is optional.
The idea here is to reduce the templating "magic" to minimum and having the spec as close to the plain yaml as possible.
(it was a hard lesson learnt by using ksonnet and forgive me being overly cautious on it :P)

metadata:
name: workflow-controller-configmap
data:
config: |
{
executorImage: argoproj/argoexec:v2.2.0,
artifactRepository:
{
s3: {
bucket: mlpipeline,
keyPrefix: artifacts,
endpoint: minio-service.default:9000,
insecure: true,
accessKeySecret: {
name: mlpipeline-minio-artifact,
key: accesskey
},
secretKeySecret: {
name: mlpipeline-minio-artifact,
key: secretkey
}
}
}
}
51 changes: 51 additions & 0 deletions manifests/base/argo/workflow-controller-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: workflow-controller
name: workflow-controller
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: workflow-controller
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: workflow-controller
spec:
containers:
- args:
- --configmap
- workflow-controller-configmap
- --executor-image
- argoproj/argoexec:v2.2.0
command:
- workflow-controller
env:
- name: ARGO_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
image: argoproj/workflow-controller:v2.2.0
imagePullPolicy: IfNotPresent
name: workflow-controller
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: argo
serviceAccountName: argo
terminationGracePeriodSeconds: 30
45 changes: 45 additions & 0 deletions manifests/base/argo/workflow-controller-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: argo-role
rules:
- apiGroups:
- ""
resources:
- pods
- pods/exec
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- watch
- list
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- create
- delete
- apiGroups:
- argoproj.io
resources:
- workflows
- workflows/finalizers
verbs:
- get
- list
- watch
- update
- patch
- delete
11 changes: 11 additions & 0 deletions manifests/base/argo/workflow-controller-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: argo-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: argo-role
subjects:
- kind: ServiceAccount
name: argo
4 changes: 4 additions & 0 deletions manifests/base/argo/workflow-controller-sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: argo
7 changes: 7 additions & 0 deletions manifests/base/crds/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- scheduled-workflow-crd.yaml
- viewer-crd.yaml
- workflow-crd.yaml
18 changes: 18 additions & 0 deletions manifests/base/crds/scheduled-workflow-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: scheduledworkflows.kubeflow.org
spec:
group: kubeflow.org
names:
kind: ScheduledWorkflow
listKind: ScheduledWorkflowList
plural: scheduledworkflows
shortNames:
- swf
singular: scheduledworkflow
scope: Namespaced
versions:
- name: v1beta1
served: true
storage: true
20 changes: 20 additions & 0 deletions manifests/base/crds/viewer-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
labels:
ksonnet.io/component: pipeline
name: viewers.kubeflow.org
spec:
group: kubeflow.org
names:
kind: Viewer
listKind: ViewerList
plural: viewers
shortNames:
- vi
singular: viewer
scope: Namespaced
versions:
- name: v1beta1
served: true
storage: true
13 changes: 13 additions & 0 deletions manifests/base/crds/workflow-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: workflows.argoproj.io
spec:
group: argoproj.io
version: v1alpha1
scope: Namespaced
names:
kind: Workflow
plural: workflows
shortNames:
- wf
27 changes: 27 additions & 0 deletions manifests/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
- argo
- crds
- minio
- mysql
- pipeline

images:
- name: argoproj/workflow-controller
newTag: v2.2.0
- name: minio/minio
newTag: RELEASE.2018-02-09T22-40-05Z
- name: mysql
newTag: "5.6"
- name: gcr.io/ml-pipeline/api-server
newTag: 0.1.20
- name: gcr.io/ml-pipeline/persistenceagent
newTag: 0.1.20
- name: gcr.io/ml-pipeline/scheduledworkflow
newTag: 0.1.20
- name: gcr.io/ml-pipeline/frontend
newTag: 0.1.20
- name: gcr.io/ml-pipeline/viewer-crd-controller
newTag: 0.1.20
8 changes: 8 additions & 0 deletions manifests/base/minio/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:
- minio-artifact-secret.yaml
- minio-deployment.yaml
- minio-pvc.yaml
- minio-service.yaml
9 changes: 9 additions & 0 deletions manifests/base/minio/minio-artifact-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
data:
accesskey: bWluaW8=
secretkey: bWluaW8xMjM=
kind: Secret
metadata:
name: mlpipeline-minio-artifact
namespace: kubeflow
type: Opaque
36 changes: 36 additions & 0 deletions manifests/base/minio/minio-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: minio
spec:
selector:
matchLabels:
app: minio
strategy:
type: Recreate
template:
metadata:
labels:
app: minio
spec:
containers:
- args:
- server
- /data
env:
- name: MINIO_ACCESS_KEY
value: minio
- name: MINIO_SECRET_KEY
value: minio123
image: minio/minio:RELEASE.2018-02-09T22-40-05Z
name: minio
ports:
- containerPort: 9000
volumeMounts:
- mountPath: /data
name: data
subPath: minio
volumes:
- name: data
persistentVolumeClaim:
claimName: minio-pvc
10 changes: 10 additions & 0 deletions manifests/base/minio/minio-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minio-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
11 changes: 11 additions & 0 deletions manifests/base/minio/minio-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: minio-service
spec:
ports:
- port: 9000
protocol: TCP
targetPort: 9000
selector:
app: minio
7 changes: 7 additions & 0 deletions manifests/base/mysql/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- mysql-deployment.yaml
- mysql-pv-claim.yaml
- mysql-service.yaml
Loading