From 35404464f4af076e15c43237bae2e9e58fbc02a7 Mon Sep 17 00:00:00 2001 From: rasmus Date: Sat, 3 Aug 2024 03:30:27 +0300 Subject: [PATCH] argo: strongarm autosync to prevent further config drift Commenting empty syncPolicy, otherwise argocd sees it as diff --- argocd/README.md | 6 +++++- ...ami-oidc.yaml => argocd-applications.yaml} | 9 +++++---- argocd/applications/asterisk.yaml | 6 +++++- argocd/applications/bind.yaml | 6 +++++- argocd/applications/camtiler.yaml | 1 - argocd/applications/etherpad.yaml | 6 +++++- argocd/applications/freescout.yaml | 6 +++++- argocd/applications/gitea.yaml | 6 +++++- argocd/applications/grafana.yaml | 6 +++++- argocd/applications/hackerspace.yaml | 6 +++++- argocd/applications/kubernetes-dashboard.yaml | 20 +++++++++++++++++++ argocd/applications/monitoring.yaml | 20 +++++++++++++++++++ argocd/applications/nextcloud.yaml | 6 +++++- argocd/applications/nyancat.yaml | 6 +++++- argocd/applications/rosdump.yaml | 6 +++++- argocd/applications/traefik.yaml | 6 +++++- argocd/applications/wiki.yaml | 6 +++++- argocd/applications/wildduck.yaml | 6 +++++- argocd/applications/woodpecker.yaml | 6 +++++- 19 files changed, 120 insertions(+), 20 deletions(-) rename argocd/applications/{whoami-oidc.yaml => argocd-applications.yaml} (70%) create mode 100644 argocd/applications/kubernetes-dashboard.yaml create mode 100644 argocd/applications/monitoring.yaml diff --git a/argocd/README.md b/argocd/README.md index b6c4e11..701fe2f 100644 --- a/argocd/README.md +++ b/argocd/README.md @@ -74,7 +74,11 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: $j - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true EOF done find applications -name "*.yaml" -exec kubectl apply -n argocd -f {} \; diff --git a/argocd/applications/whoami-oidc.yaml b/argocd/applications/argocd-applications.yaml similarity index 70% rename from argocd/applications/whoami-oidc.yaml rename to argocd/applications/argocd-applications.yaml index 048072f..f93c1ea 100644 --- a/argocd/applications/whoami-oidc.yaml +++ b/argocd/applications/argocd-applications.yaml @@ -2,16 +2,17 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: whoami-oidc + name: argocd-applications namespace: argocd spec: project: k-space.ee source: repoURL: 'git@git.k-space.ee:k-space/kube.git' - path: whoami-oidc + path: argocd/applications targetRevision: HEAD destination: server: 'https://kubernetes.default.svc' - namespace: whoami-oidc + namespace: argocd syncPolicy: - automated: {} + automated: + prune: false diff --git a/argocd/applications/asterisk.yaml b/argocd/applications/asterisk.yaml index cb8b672..e53e001 100644 --- a/argocd/applications/asterisk.yaml +++ b/argocd/applications/asterisk.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: asterisk - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/bind.yaml b/argocd/applications/bind.yaml index 502040a..98fd9c4 100644 --- a/argocd/applications/bind.yaml +++ b/argocd/applications/bind.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: bind - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/camtiler.yaml b/argocd/applications/camtiler.yaml index 4ae4416..208d193 100644 --- a/argocd/applications/camtiler.yaml +++ b/argocd/applications/camtiler.yaml @@ -13,4 +13,3 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: camtiler - syncPolicy: {} diff --git a/argocd/applications/etherpad.yaml b/argocd/applications/etherpad.yaml index a10691d..6740711 100644 --- a/argocd/applications/etherpad.yaml +++ b/argocd/applications/etherpad.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: etherpad - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/freescout.yaml b/argocd/applications/freescout.yaml index b3bab4a..721e147 100644 --- a/argocd/applications/freescout.yaml +++ b/argocd/applications/freescout.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: freescout - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/gitea.yaml b/argocd/applications/gitea.yaml index 9973ae2..d90189a 100644 --- a/argocd/applications/gitea.yaml +++ b/argocd/applications/gitea.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: gitea - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/grafana.yaml b/argocd/applications/grafana.yaml index 5c5fb68..12ab0f3 100644 --- a/argocd/applications/grafana.yaml +++ b/argocd/applications/grafana.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: grafana - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/hackerspace.yaml b/argocd/applications/hackerspace.yaml index 14e9216..6290839 100644 --- a/argocd/applications/hackerspace.yaml +++ b/argocd/applications/hackerspace.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: hackerspace - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/kubernetes-dashboard.yaml b/argocd/applications/kubernetes-dashboard.yaml new file mode 100644 index 0000000..8901bac --- /dev/null +++ b/argocd/applications/kubernetes-dashboard.yaml @@ -0,0 +1,20 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: kubernetes-dashboard + namespace: argocd +spec: + project: default + source: + repoURL: 'git@git.k-space.ee:k-space/kube.git' + path: kubernetes-dashboard + targetRevision: HEAD + destination: + server: 'https://kubernetes.default.svc' + namespace: kubernetes-dashboard + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/monitoring.yaml b/argocd/applications/monitoring.yaml new file mode 100644 index 0000000..c3fc4ce --- /dev/null +++ b/argocd/applications/monitoring.yaml @@ -0,0 +1,20 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: monitoring + namespace: argocd +spec: + project: k-space.ee + source: + repoURL: 'git@git.k-space.ee:k-space/kube.git' + path: monitoring + targetRevision: HEAD + destination: + server: 'https://kubernetes.default.svc' + namespace: monitoring + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/nextcloud.yaml b/argocd/applications/nextcloud.yaml index 8870c49..23f77f7 100644 --- a/argocd/applications/nextcloud.yaml +++ b/argocd/applications/nextcloud.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: nextcloud - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/nyancat.yaml b/argocd/applications/nyancat.yaml index 10cc083..9de223b 100644 --- a/argocd/applications/nyancat.yaml +++ b/argocd/applications/nyancat.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: nyancat - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/rosdump.yaml b/argocd/applications/rosdump.yaml index e32309b..c973539 100644 --- a/argocd/applications/rosdump.yaml +++ b/argocd/applications/rosdump.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: rosdump - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/traefik.yaml b/argocd/applications/traefik.yaml index b230520..7b6ab13 100644 --- a/argocd/applications/traefik.yaml +++ b/argocd/applications/traefik.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: traefik - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/wiki.yaml b/argocd/applications/wiki.yaml index 973af0c..f63a030 100644 --- a/argocd/applications/wiki.yaml +++ b/argocd/applications/wiki.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: wiki - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/wildduck.yaml b/argocd/applications/wildduck.yaml index 2c80540..0a57626 100644 --- a/argocd/applications/wildduck.yaml +++ b/argocd/applications/wildduck.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: wildduck - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/argocd/applications/woodpecker.yaml b/argocd/applications/woodpecker.yaml index fc2c805..d55e20a 100644 --- a/argocd/applications/woodpecker.yaml +++ b/argocd/applications/woodpecker.yaml @@ -13,4 +13,8 @@ spec: destination: server: 'https://kubernetes.default.svc' namespace: woodpecker - syncPolicy: {} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true