Skip to content

Instantly share code, notes, and snippets.

@jhoelzel
Last active September 7, 2023 07:07
Show Gist options
  • Save jhoelzel/c39d7e29836f0d0308e7093c8000df72 to your computer and use it in GitHub Desktop.
Save jhoelzel/c39d7e29836f0d0308e7093c8000df72 to your computer and use it in GitHub Desktop.
argo ApplicationSet to deploy an application to two argo cd instances at the same time
{
"appName": "production-deployment",
"destNamespace": "prod"
}
{
"appName": "production-deployment",
"destNamespace": "prod"
}
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
annotations:
argocd.argoproj.io/sync-wave: "3"
labels:
app.kubernetes.io/managed-by: argocd
name: gitopsexample-a
namespace: argocd
spec:
generators:
- git:
files:
- path: myapps/**/production/config-a.json
repoURL: git@github.com:hoelzel-it/gitpos.git
revision: HEAD
syncPolicy: {}
template:
metadata:
labels:
app.kubernetes.io/managed-by: argocd
app.kubernetes.io/name: "{{ appName }}"
name: "{{ appName }}"
namespace: argocd
spec:
destination:
namespace: "{{ destNamespace }}"
server: https://kubernetes.default.svc
project: production
source:
path: "{{ path }}"
repoURL: git@github.com:hoelzel-it/gitopsexample.git
targetRevision: HEAD
syncPolicy:
automated:
allowEmpty: true
prune: true
selfHeal: true
status: {}
apiVersion: argoproj.io/v1alpha1
----
kind: ApplicationSet
metadata:
annotations:
argocd.argoproj.io/sync-wave: "3"
labels:
app.kubernetes.io/managed-by: argocd
name: gitopsexample-b
namespace: argocd
spec:
generators:
- git:
files:
- path: myapps/**/production/config-b.json
repoURL: git@github.com:hoelzel-it/gitpos.git
revision: HEAD
syncPolicy: {}
template:
metadata:
labels:
app.kubernetes.io/managed-by: argocd
app.kubernetes.io/name: "{{ appName }}"
name: "{{ appName }}"
namespace: argocd
spec:
destination:
namespace: "{{ destNamespace }}"
server: <theothercluster>
project: production
source:
path: "{{ path }}"
repoURL: git@github.com:hoelzel-it/gitopsexample.git
targetRevision: HEAD
syncPolicy:
automated:
allowEmpty: true
prune: true
selfHeal: true
status: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment