Skip to content

Instantly share code, notes, and snippets.

@initcron
Created February 23, 2025 13:33
Show Gist options
  • Save initcron/e6c65049b3a36b43060e92a7b5db63f6 to your computer and use it in GitHub Desktop.
Save initcron/e6c65049b3a36b43060e92a7b5db63f6 to your computer and use it in GitHub Desktop.
ApplicationSet to iternate over a matrix of 2 charts (services = vote, redis) and 3 environments 2x3 = 6 application specs.
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: instavote
namespace: argocd
spec:
generators:
- matrix:
generators:
- git:
repoURL: https://github.com/initcron/instavote-gitops
revision: HEAD
directories:
- path: "charts/*"
- list:
elements:
- environment: dev
namespace: instavote-dev
- environment: staging
namespace: instavote-staging
- environment: prod
namespace: instavote-prod
template:
metadata:
name: '{{path.basename}}-{{environment}}'
annotations:
debug.path: '{{path}}'
spec:
project: instavote-{{environment}}
source:
repoURL: https://github.com/initcron/instavote-gitops
targetRevision: HEAD
path: '{{path}}'
helm:
valueFiles:
- env/{{environment}}.yaml
destination:
server: https://kubernetes.default.svc
namespace: '{{namespace}}'
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment