applicationset
applicationset copied to clipboard
skip or exclude some applications deployment from particular env
Hi,
is there way we can exclude some directories/apps for particular cluster?
below is my repository structure(mono repo). I'm using Matrix generator with git and list generator to deploy all the applications in the apps dir. Some application we want to skip deployment to prod cluster e.g app2
in below structure .
Currently i have created a single applicationset-matrix.yaml file.
.
├── applicationset-matrix.yaml
└── apps
├── app1
│ ├── Chart.yaml
│ ├── dev
│ │ └── values.yaml
│ ├── preprod
│ │ └── values.yaml
│ ├── prod
│ │ └── values.yaml
│ ├── templates
│ │ ├── NOTES.txt
│ │ ├── _helpers.tpl
│ │ ├── deployment.yaml
│ │ ├── ingress.yaml
│ │ ├── service.yaml
│ │ ├── serviceaccount.yaml
│ └── values.yaml
└── app2 (Helm Chart)
I am also interested in this
It sounds like you were looking for ways to exclude particular combinations generated by the matrix generator?
For example, if matrix generator:
- matrix
generator1: (...)
generator2: (...)
If generator1 produced a, b, c
and generator2 produced d, e, f
then the matrix generator will generate ad, ae, af, bc, be, bf, cd, ce, cf
, etc. Do I have it right that you are looking for a mechanism to prevent some of those combinations from being emitted?
Have a similar use case:
spec:
generators:
- matrix:
generators:
- git:
repoURL: <..>
revision: HEAD
directories:
- path: "apps/production/*"
- clusters:
selector:
matchLabels:
argocd.argoproj.io/secret-type: cluster
environment: production
template:
metadata: {}
spec:
project: production
source:
repoURL: <..>
targetRevision: HEAD
path: '{{path}}'
helm:
releaseName: '{{path.basename}}'
valueFiles:
- '{{name}}.yaml'
- values.yaml
destination: {}
template:
metadata:
name: '{{path.basename}}.{{name}}'
spec:
project: production
source:
repoURL: <..>
targetRevision: HEAD
path: '{{path}}'
helm:
releaseName: '{{path.basename}}'
destination:
name: '{{name}}'
namespace: '{{path.basename}}'
Here I want to override helm.valueFiles to include cluster specific values along with defaults by using '{{name}}.yaml
.
At the same time, it's desired for some apps to be excluded from certain clusters and only target a single production cluster. It would be nice to achieve this with a single ApplicationSet and not have to separate production applications into separate folders.
It sounds like you were looking for ways to exclude particular combinations generated by the matrix generator?
For example, if matrix generator:
- matrix generator1: (...) generator2: (...)
If generator1 produced
a, b, c
and generator2 producedd, e, f
then the matrix generator will generatead, ae, af, bc, be, bf, cd, ce, cf
, etc. Do I have it right that you are looking for a mechanism to prevent some of those combinations from being emitted?
Yes, you are right.
I managed to achieve the same request using Post selector all generators (introduced in #361).
Also interested in this. The current workaround we are thinking of is having an AppSet per cluster, but it is not good enough, we would really to like use one AppSet to install all apps on all clusters, having the freedom to exclude particular apps from particular clusters.