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

Leverage ApplicationSets for stacks/argo #109

Closed
wants to merge 3 commits into from
Closed
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
31 changes: 17 additions & 14 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ silent: true
vars:
CLUSTER_NAME: kubeflow
CONTEXT_NAME: "k3d-{{.CLUSTER_NAME}}"
ARGOCD_MANIFEST: argoproj-labs/applicationset/v0.3.0/manifests/install-with-argo-cd.yaml
KUBECTL: "kubectl --context={{.CONTEXT_NAME}}"
KUBEAPPLY: "{{.KUBECTL}} apply"
KUSTOMIZE: "{{.KUBECTL}} kustomize"
Expand Down Expand Up @@ -49,7 +50,9 @@ tasks:
prefix: k3d > create
desc: create k3d cluster
cmds:
- k3d cluster create --config=cluster/config.yaml
- "k3d cluster create --config=cluster/config.yaml"
- "{{.KUBECTL}} create namespace argocd"
- "{{.KUBECTL}} apply -n argocd -f https://raw.githubusercontent.com/{{.ARGOCD_MANIFEST}}"

k3d:destroy:
prefix: k3d > destroy
Expand All @@ -75,23 +78,23 @@ tasks:
cmds:
- "echo TBD"

stack:aaw:
prefix: stacks > aaw
desc: install the AAW Stack
dir: ./kustomize
stack:upstream:
prefix: stacks > upstream
desc: install the Upstream manifests
dir: ./examples
cmds:
- "{{.KUSTOMIZE}} stacks/aaw"
- "{{.KUBEAPPLY}} -f kubeflow-appset-aaw.yaml"

stack:argo:
prefix: stacks > argo
desc: install the Argo Stack
dir: ./kustomize
stack:aaw:
prefix: stacks > aaw
desc: install the AAW overlay
dir: ./examples
cmds:
- "{{.KUSTOMIZE}} stacks/argo"
- "{{.KUBEAPPLY}} -f kubeflow-appset-aaw.yaml"

stack:local:
prefix: stacks > local
desc: install the Local Stack
dir: ./kustomize
desc: install the local-dev overlay
dir: ./examples
cmds:
- "{{.KUSTOMIZE}} stacks/local"
- "{{.KUBEAPPLY}} -f kubeflow-appset-local-dev.yaml"
54 changes: 54 additions & 0 deletions examples/kubeflow-appset-aaw.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: kubeflow
namespace: argocd
spec:
generators:
- list:
elements:
- app: katib
folder: apps
overlay: aaw
version: main

- app: kfserving
folder: apps
overlay: aaw
version: main

- app: pipeline
folder: apps
overlay: aaw
version: main

- app: kubeflow-namespace
folder: common
overlay: aaw
version: main

- app: kubeflow-roles
folder: common
overlay: aaw
version: main

- app: oidc-authservice
folder: common
overlay: aaw
version: main
template:
metadata:
name: 'kubeflow-{{app}}'
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/statcan/aaw-kubeflow-manifests.git
targetRevision: {{version}}
path: kustomize/{{folder}}/{{app}}/overlays/{{overlay}}
destination:
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: true
selfHeal: true
54 changes: 54 additions & 0 deletions examples/kubeflow-appset-local-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: kubeflow
namespace: argocd
spec:
generators:
- list:
elements:
- app: katib
folder: apps
overlay: local-dev
version: main

- app: kfserving
folder: apps
overlay: local-dev
version: main

- app: pipeline
folder: apps
overlay: local-dev
version: main

- app: kubeflow-namespace
folder: common
overlay: local-dev
version: main

- app: kubeflow-roles
folder: common
overlay: local-dev
version: main

- app: oidc-authservice
folder: common
overlay: local-dev
version: main
template:
metadata:
name: 'kubeflow-{{app}}'
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/statcan/aaw-kubeflow-manifests.git
targetRevision: {{version}}
path: kustomize/{{folder}}/{{app}}/overlays/{{overlay}}
destination:
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: true
selfHeal: true
54 changes: 54 additions & 0 deletions examples/kubeflow-appset-upstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: kubeflow
namespace: argocd
spec:
generators:
- list:
elements:
- app: katib
folder: apps
overlay: upstream
version: main

- app: kfserving
folder: apps
overlay: upstream
version: main

- app: pipeline
folder: apps
overlay: upstream
version: main

- app: kubeflow-namespace
folder: common
overlay: upstream
version: main

- app: kubeflow-roles
folder: common
overlay: upstream
version: main

- app: oidc-authservice
folder: common
overlay: upstream
version: main
template:
metadata:
name: 'kubeflow-{{app}}'
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/statcan/aaw-kubeflow-manifests.git
targetRevision: {{version}}
path: kustomize/{{folder}}/{{app}}/overlays/{{overlay}}
destination:
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: true
selfHeal: true
51 changes: 46 additions & 5 deletions kustomize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,58 @@ While the upstream location is organized under three (3) main directories we hav
| `apps` | Kubeflow's official components, as maintained by the respective Kubeflow WGs |
| `common` | Common services, as maintained by the Manifests WG |
| `contrib` | 3rd party contributed applications, which are maintained externally and are not part of a Kubeflow WG |
| `stacks` | Different type of configurations for Kubeflow and its dependencies (`aaw`, `argo`, `upstream`) |

## Stacks
## Application Sets

All the applications can be deployed at once using an `ApplicationSet`. See `examples/` for versions. The following deploys all apps, but lets you configure the version and overlay of each app.

```yaml
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: kubeflow
namespace: argocd
spec:
generators:
- list:
elements:
- app: katib
folder: apps
overlay: aaw
version: main

- app: kfserving
folder: apps
overlay: aaw
version: main
# truncated...
template:
metadata:
name: 'kubeflow-{{app}}'
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/statcan/aaw-kubeflow-manifests.git
targetRevision: {{version}}
path: kustomize/{{folder}}/{{app}}/overlays/{{overlay}}
destination:
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: true
selfHeal: true
```

## Overlays

Different type of configurations for Kubeflow and its dependencies.

| Directory | Purpose |
| Overlay | Purpose |
| ---------- | ----------------------------------------------------------------------------- |
| `aaw` | Installs Kubeflow on top of Statistics Canada Cloud Native Platform |
| `argo` | Provides ArgoCD Project Metadata to facilitate a GitOps deployment model |
| `upstream` | Installs a generalized Kubeflow useful for testing and accessing new features |
| `aaw` | Installs Kubeflow on top of Statistics Canada Cloud Native Platform |
| `local-dev`| Builds on `aaw` but allows patching suitable for local development |

<!-- Links Referenced -->

Expand Down
5 changes: 5 additions & 0 deletions kustomize/apps/katib/overlays/aaw/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:
- ../../base/
5 changes: 5 additions & 0 deletions kustomize/apps/katib/overlays/local-dev/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:
- ../aaw/
5 changes: 5 additions & 0 deletions kustomize/apps/katib/overlays/upstream/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:
- ../../base/
5 changes: 5 additions & 0 deletions kustomize/apps/kfserving/overlays/aaw/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:
- ../../base/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../aaw/
5 changes: 5 additions & 0 deletions kustomize/apps/kfserving/overlays/upstream/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:
- ../../base/
5 changes: 5 additions & 0 deletions kustomize/apps/pipeline/overlays/aaw/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:
- ../../base/
5 changes: 5 additions & 0 deletions kustomize/apps/pipeline/overlays/local-dev/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:
- ../aaw/
5 changes: 5 additions & 0 deletions kustomize/apps/pipeline/overlays/upstream/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:
- ../../base/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../aaw/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../aaw/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../aaw/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base/
Empty file added kustomize/contrib/.gitignore
Empty file.
Loading