Skip to content

Commit

Permalink
Kubeflow Tekton Pipelines: Sync manifests (kubeflow#1843)
Browse files Browse the repository at this point in the history
Sync manifests for application "Kubeflow Tekton Pipelines".
Upstream manifests are copied from:
- Repo: https://github.com/kubeflow/kfp-tekton
- Path: manifests/kustomize
- Revision: v0.8.0-rc0

Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
  • Loading branch information
yanniszark committed Apr 14, 2021
1 parent 3a21826 commit 56699de
Show file tree
Hide file tree
Showing 351 changed files with 50,622 additions and 0 deletions.
29 changes: 29 additions & 0 deletions apps/kfp-tekton/upstream/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This makefile is a quick test to verify all manifests can be hydrated.

test: aws azure dev gcp platform-agnostic platform-agnostic-multi-user plain plain-multi-user

aws: FORCE
kubectl kustomize env/aws

azure: FORCE
kubectl kustomize env/azure

dev: FORCE
kubectl kustomize env/dev

gcp: FORCE
kubectl kustomize env/gcp

platform-agnostic: FORCE
kubectl kustomize env/platform-agnostic

platform-agnostic-multi-user: FORCE
kustomize build --load_restrictor none env/platform-agnostic-multi-user

plain: FORCE
kubectl kustomize env/plain

plain-multi-user: FORCE
kustomize build --load_restrictor none env/plain-multi-user

FORCE: ;
158 changes: 158 additions & 0 deletions apps/kfp-tekton/upstream/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# Kubeflow Pipelines Kustomize Manifest Folder

## Install Kubeflow Pipelines

This folder contains Kubeflow Pipelines Kustomize manifests for a light weight
deployment. You can follow the instruction and deploy Kubeflow Pipelines in an
existing cluster.

To install Kubeflow Pipelines, you have several options.

- Via an upcoming commandline tool.
- Via Kubectl with Kustomize, it's detailed here.

### Install via Kustomize

Deploy latest version of Kubeflow Pipelines.

It uses following default settings.

- image: latest released images
- namespace: kubeflow
- application name: pipeline

#### Option-1 Install it to any K8s cluster

It's based on in-cluster PersistentVolumeClaim storage.

```bash
kubectl apply -k cluster-scoped-resources/
kubectl wait crd/applications.app.k8s.io --for condition=established --timeout=60s
kubectl apply -k env/platform-agnostic/
kubectl wait pods -l application-crd-id=kubeflow-pipelines -n kubeflow --for condition=Ready --timeout=1800s
kubectl port-forward -n kubeflow svc/ml-pipeline-ui 8080:80
```

Now you can access it via localhost:8080

#### Option-2 Install it to GCP with in-cluster PersistentVolumeClaim storage

It's based on in-cluster PersistentVolumeClaim storage.
Additionally, it introduced a proxy in GCP to allow user easily access KFP safely.

```bash
kubectl apply -k cluster-scoped-resources/
kubectl wait crd/applications.app.k8s.io --for condition=established --timeout=60s

kubectl apply -k env/dev/
kubectl wait applications/pipeline -n kubeflow --for condition=Ready --timeout=1800s

# Or visit http://console.cloud.google.com/ai-platform/pipelines
kubectl describe configmap inverse-proxy-config -n kubeflow | grep googleusercontent.com
```

#### Option-3 Install it to GCP with CloudSQL & GCS-Minio managed storage

Its storage is based on CloudSQL & GCS. It's better than others for production usage.

Please following [sample](sample/README.md) for a customized installation.

#### Option-4 Install it to AWS with S3 and RDS MySQL

Its storage is based on S3 & AWS RDS. It's more natural for AWS users to use this option.

Please following [AWS Instructions](env/aws/README.md) for installation.

Note: Community maintains a repo [e2fyi/kubeflow-aws](https://github.com/e2fyi/kubeflow-aws/tree/master/pipelines) for AWS.

#### Option-5 Install it to IBM Cloud with in-cluster PersistentVolumeClaim storage

It's based on in-cluster PersistentVolumeClaim storage.
Additionally, it uses the ibm cloud NFS storage with UID support to make sure all pods can run as non-root users.

Please follow the [IKS group ID storage setup](https://www.kubeflow.org/docs/ibm/deploy/install-kubeflow-on-iks/#ibm-cloud-group-id-storage-setup)
before running the below commands.

```bash
kubectl apply -k cluster-scoped-resources/
kubectl wait crd/applications.app.k8s.io --for condition=established --timeout=60s
kubectl apply -k env/platform-agnostic/
kubectl wait pods -l application-crd-id=kubeflow-pipelines -n kubeflow --for condition=Ready --timeout=1800s
kubectl port-forward -n kubeflow svc/ml-pipeline-ui 8080:80
```

## Uninstall

If the installation is based on CloudSQL/GCS, after the uninstall, the data is still there,
reinstall a newer version can reuse the data.

```bash
### 1. namespace scoped
# Depends on how you installed it:
kubectl kustomize env/platform-agnostic/ | kubectl delete -f -
# or
kubectl kustomize env/dev | kubectl delete -f -
# or
kubectl kustomize env/gcp | kubectl delete -f -
# or
kubectl delete applications/pipeline -n kubeflow

### 2. cluster scoped
kubectl delete -k cluster-scoped-resources/
```

## Troubleshooting

### Permission error installing Kubeflow Pipelines to a cluster

Run

```bash
kubectl create clusterrolebinding your-binding --clusterrole=cluster-admin --user=[your-user-name]
```

### Samples requires "user-gcp-sa" secret

If sample code requires a "user-gcp-sa" secret, you could create one by

- First download the GCE VM service account token
[Document](https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating_service_account_keys)

```bash
gcloud iam service-accounts keys create application_default_credentials.json \
--iam-account [SA-NAME]@[PROJECT-ID].iam.gserviceaccount.com
```

- Run

```bash
kubectl create secret -n [your-namespace] generic user-gcp-sa --from-file=user-gcp-sa.json=application_default_credentials.json`
```

## Folder Structure

### Overview

- User facing manifest entrypoints are `cluster-scoped-resources` package and `env/<env-name>` package.
- `cluster-scoped-resources` should collect all cluster-scoped resources.
- `env/<env-name>` should collect env specific namespace-scoped resources.
- Note, for multi-user envs, they already included cluster-scoped resources.
- KFP core components live in `base/<component-name>` folders.
- If a component requires cluster-scoped resources, it should have a folder inside named `cluster-scoped` with related resources, but note that `base/<component-name>/kustomization.yaml` shouldn't include the `cluster-scoped` folder. `cluster-scoped` folders should be collected by top level `cluster-scoped-resources` folder.
- KFP core installations are in `base/installs/<install-type>`, they only include the core KFP components, not third party ones.
- Third party components live in `third-party/<component-name>` folders.
### For direct deployments
Env specific overlays live in `env/<env-name>` folders, they compose above components to get ready for directly deploying.
### For downstream consumers
Please compose `base/installs/<install-type>` and third party dependencies based on your own requirements.
### Rationale
Constraints for namespaced installation we need to comply with (that drove above structure):
- CRDs must be applied separately, because if we apply CRs in the same `kubectl apply` command, the CRD may not have been accepted by k8s api server (e.g. Application CRD).
- [A Kubeflow 1.0 constraint](https://github.com/kubeflow/pipelines/issues/2884#issuecomment-577158715) is that we should separate cluster scoped resources from namespace scoped resources, because sometimes different roles are required to deploy them. Cluster scoped resources usually need a cluster admin role, while namespaced resources can be deployed by individual teams managing a namespace.
49 changes: 49 additions & 0 deletions apps/kfp-tekton/upstream/base/application/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Note, this application.yaml is not included by default for most environments.

apiVersion: app.k8s.io/v1beta1
kind: Application
metadata:
name: $(kfp-app-name)
annotations:
kubernetes-engine.cloud.google.com/icon: >-
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAyCAYAAADx/eOPAAALuUlEQVRogd2afWxd9XnHP99bK4pS3yhiGUIRiiJUVVVqbq8ppdR20ibqpuIMtDRkUYERp29J57gMZVuxsrZiK7oZXVv5re1AiOuoG+N1DMkuytprsGPEVMouxqQZJVHEWIdQlGVxZlmZdb/747zcc869jpMO+seOdPz7nd/L83tev89zzjX8Bq795Rq9o17zXp+Tey+Ijkyboela29DRWkhffyT733pH/Z3este9F2cC6N0kNjxtjD+FdRD8UF9X7u97y7UbQFPAivC0BdllS381slun3s3z3xVhhqeds90tqR/oMB7u68z19ZZra0E/l1if3WOziPx3skrDPTr+bvDxfxImEIJbgX6gGBJ7EfHJX/ySReDHwO9KYAenyWCMFKw21GSeslwa2Z17+TcuzPBRr7B8m6Df5oOJqdPAR/u6cm/2lmv3At+IT3GiXZqbcaxSLsfRoTsvn7XL2jE87ZXGnwf+VGiDY86ETM1wU1+XjvSW/RlgTJADQ2QaCZKWcX1/aDIcjE8i3SdzZLjn0lm8pJXD02417BM+gLmq2Rqjr/d16Vu95dp6wc8Ra5O8NrPIcoZCvIR1H+KZkd2qLcfnRYUZOuorJO+3uQt0RerolGYZR7r5+C9ZATwPviGyQprd6Liszy3bnwVKwGMjPbnFyxJmeNpX2T4gaR/QmmSpyYZTho/2depMb9k/kNh3KawuJ1bWauHzUcyXRpZAv5Zmg7aHBLcmNN9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AwGlBKnoB5747c2J+aSJEuvRL8CDv/2Zz+cqh/LL/gPD//vrfwFjcI5oX6jDBwAAAABJRU5ErkJggg==
marketplace.cloud.google.com/deploy-info: '{"partner_id": "google-cloud-ai-platform", "product_id": "kubeflow-pipelines", "partner_name": "Google Cloud AI Platform"}'
spec:
addOwnerRef: true
selector:
matchLabels:
application-crd-id: kubeflow-pipelines
descriptor:
version: $(kfp-app-version)
type: Kubeflow Pipelines
description: |-
Reusable end-to-end ML workflow
maintainers:
- name: Google Cloud AI Platform
url: https://cloud.google.com/ai-platform/
- name: Kubeflow Pipelines
url: https://github.com/kubeflow/pipelines
links:
- description: 'Kubeflow Pipelines Documentation'
url: https://www.kubeflow.org/docs/pipelines/
notes: |-
Please go to [Hosted Kubeflow Pipelines Console](https://console.cloud.google.com/ai-platform/pipelines/clusters).
info:
- name: Console
value: 'https://console.cloud.google.com/ai-platform/pipelines/clusters'
componentKinds:
- group: v1
kind: ServiceAccount
- group: rbac.authorization.k8s.io/v1
kind: Role
- group: rbac.authorization.k8s.io/v1
kind: RoleBinding
- group: v1
kind: Service
- group: v1
kind: ConfigMap
- group: v1
kind: Secret
- group: apps/v1
kind: Deployment
5 changes: 5 additions & 0 deletions apps/kfp-tekton/upstream/base/application/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:
- application.yaml

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cache-deployer-deployment
labels:
app: cache-deployer
spec:
replicas: 1
selector:
matchLabels:
app: cache-deployer
strategy:
type: Recreate
template:
metadata:
labels:
app: cache-deployer
spec:
containers:
- name: main
image: gcr.io/ml-pipeline/cache-deployer:dummy
imagePullPolicy: Always
env:
- name: NAMESPACE_TO_WATCH
valueFrom:
fieldRef:
fieldPath: metadata.namespace
serviceAccountName: kubeflow-pipelines-cache-deployer-sa
restartPolicy: Always
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app: kubeflow-pipelines-cache-deployer-role
name: kubeflow-pipelines-cache-deployer-role
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- delete
- get
- patch
- list
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kubeflow-pipelines-cache-deployer-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kubeflow-pipelines-cache-deployer-role
subjects:
- kind: ServiceAccount
name: kubeflow-pipelines-cache-deployer-sa
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app: kubeflow-pipelines-cache-deployer-clusterrole
name: kubeflow-pipelines-cache-deployer-clusterrole
rules:
- apiGroups:
- certificates.k8s.io
resources:
- certificatesigningrequests
- certificatesigningrequests/approval
verbs:
- create
- delete
- get
- update
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
verbs:
- create
- delete
- get
- list
- patch
- apiGroups:
- certificates.k8s.io
resources:
- signers
resourceNames:
- kubernetes.io/*
verbs:
- approve
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubeflow-pipelines-cache-deployer-clusterrolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubeflow-pipelines-cache-deployer-clusterrole
subjects:
- kind: ServiceAccount
name: kubeflow-pipelines-cache-deployer-sa
# namespace will be added by kustomize automatically according to the namespace field in kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubeflow-pipelines-cache-deployer-sa
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- cache-deployer-clusterrole.yaml
- cache-deployer-clusterrolebinding.yaml
# HACK: although a service account(SA) is not a cluster-scoped resource.
# Presence of a SA referred by a clusterrolebinding allows kustomize to auto-add
# namespace for the clusterrolebinding's SA ref.
- cache-deployer-sa.yaml

13 changes: 13 additions & 0 deletions apps/kfp-tekton/upstream/base/cache-deployer/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- cluster-scoped
resources:
- cache-deployer-role.yaml
- cache-deployer-rolebinding.yaml
- cache-deployer-deployment.yaml
commonLabels:
app: cache-deployer
images:
- name: gcr.io/ml-pipeline/cache-deployer
newTag: 1.5.0-rc.2
Loading

0 comments on commit 56699de

Please sign in to comment.