stacks/vcluster-multi-env/vclusters.yaml
Greg Haynes 80d62e30a4
Add vcluster-multi-env stack (#44)
Signed-off-by: Greg Haynes <greg.haynes@autodesk.com>
2024-11-01 12:16:55 -07:00

78 lines
No EOL
2.5 KiB
YAML

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: vclusters
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- list:
elements:
- name: staging
- name: production
template:
metadata:
name: '{{.name}}-vcluster'
labels:
cnoe.io/stackName: vcluster-multi-env
cnoe.io/applicationName: vcluster-package
finalizers:
- resources-finalizer.argocd.argoproj.io # enabling cascading deletion
spec:
project: 'default'
source:
repoURL: cnoe://
targetRevision: HEAD
path: vcluster
kustomize:
patches:
- target:
labelSelector: cnoe.io/stackName=vcluster-multi-env
kind: Ingress
patch: |-
- op: replace
path: /spec/rules/0/host
value: {{.name}}-vcluster.cnoe.localtest.me
- target:
labelSelector: cnoe.io/stackName=vcluster-multi-env
kind: Ingress
patch: |-
- op: replace
path: /spec/rules/0/http/paths/0/backend/service/name
value: {{.name}}-vcluster-helm
- target:
labelSelector: cnoe.io/stackName=vcluster-multi-env
kind: Application
patch: |-
- op: replace
path: /metadata/name
value: {{.name}}-vcluster-helm
- target:
labelSelector: cnoe.io/stackName=vcluster-multi-env
kind: Application
patch: |-
- op: replace
path: /spec/source/helm/valuesObject/controlPlane/proxy/extraSANs/0
value: {{.name}}-vcluster.cnoe.localtest.me
- target:
labelSelector: cnoe.io/stackName=vcluster-multi-env
kind: Application
patch: |-
- op: replace
path: /spec/source/helm/valuesObject/exportKubeConfig/server
value: https://{{.name}}-vcluster.cnoe.localtest.me:443
- target:
labelSelector: cnoe.io/stackName=vcluster-multi-env
kind: Application
patch: |-
- op: replace
path: /spec/destination/namespace
value: {{.name}}-vcluster
destination:
server: "https://kubernetes.default.svc"
namespace: '{{.name}}-vcluster'
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true