From cd037ff1cd73bed0e85d53f1c5ee5f97828f8b44 Mon Sep 17 00:00:00 2001 From: Alexandre Gaudreault Date: Mon, 11 Mar 2024 11:27:57 -0400 Subject: [PATCH] sync all apps Signed-off-by: Alexandre Gaudreault --- .gitignore | 1 + apps/templates/applications.yaml | 29 +++++++++++++++++++ apps/templates/helm-guestbook.yaml | 16 ----------- apps/templates/helm-hooks.yaml | 17 ------------ apps/templates/kustomize-guestbook.yaml | 16 ----------- apps/templates/namespaces.yaml | 27 ------------------ apps/templates/sync-waves.yaml | 16 ----------- apps/values.yaml | 37 +++++++++++++++++++++---- 8 files changed, 61 insertions(+), 98 deletions(-) create mode 100644 .gitignore create mode 100644 apps/templates/applications.yaml delete mode 100644 apps/templates/helm-guestbook.yaml delete mode 100644 apps/templates/helm-hooks.yaml delete mode 100644 apps/templates/kustomize-guestbook.yaml delete mode 100644 apps/templates/namespaces.yaml delete mode 100644 apps/templates/sync-waves.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..db6e1b5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/**/charts/ diff --git a/apps/templates/applications.yaml b/apps/templates/applications.yaml new file mode 100644 index 0000000..7bdb0a6 --- /dev/null +++ b/apps/templates/applications.yaml @@ -0,0 +1,29 @@ +{{- range .Values.applications }} +{{- $config := $.Values.config -}} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: {{ printf "example.%s" .name | quote }} + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: {{ .namespace | default .name | quote }} + server: {{ $config.spec.destination.server | quote }} + project: default + source: + path: {{ .path | default .name | quote }} + repoURL: {{ $config.spec.source.repoURL }} + targetRevision: {{ $config.spec.source.targetRevision }} + {{- with .tool }} + {{- . | toYaml | nindent 4 }} + {{- end }} + syncPolicy: + syncOptions: + - CreateNamespace=true + automated: + prune: true + selfHeal: true +--- +{{ end -}} diff --git a/apps/templates/helm-guestbook.yaml b/apps/templates/helm-guestbook.yaml deleted file mode 100644 index e1e5a8b..0000000 --- a/apps/templates/helm-guestbook.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: helm-guestbook - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - destination: - namespace: helm-guestbook - server: {{ .Values.spec.destination.server }} - project: default - source: - path: helm-guestbook - repoURL: {{ .Values.spec.source.repoURL }} - targetRevision: {{ .Values.spec.source.targetRevision }} diff --git a/apps/templates/helm-hooks.yaml b/apps/templates/helm-hooks.yaml deleted file mode 100644 index 5f65a8d..0000000 --- a/apps/templates/helm-hooks.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: helm-hooks - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - destination: - namespace: helm-hooks - server: {{ .Values.spec.destination.server }} - project: default - source: - path: helm-hooks - repoURL: {{ .Values.spec.source.repoURL }} - targetRevision: {{ .Values.spec.source.targetRevision }} - diff --git a/apps/templates/kustomize-guestbook.yaml b/apps/templates/kustomize-guestbook.yaml deleted file mode 100644 index 7a36476..0000000 --- a/apps/templates/kustomize-guestbook.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: kustomize-guestbook - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - destination: - namespace: kustomize-guestbook - server: {{ .Values.spec.destination.server }} - project: default - source: - path: kustomize-guestbook - repoURL: {{ .Values.spec.source.repoURL }} - targetRevision: {{ .Values.spec.source.targetRevision }} diff --git a/apps/templates/namespaces.yaml b/apps/templates/namespaces.yaml deleted file mode 100644 index 435e4ba..0000000 --- a/apps/templates/namespaces.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: helm-guestbook - annotations: - argocd.argoproj.io/sync-wave: "-1" ---- -apiVersion: v1 -kind: Namespace -metadata: - name: helm-hooks - annotations: - argocd.argoproj.io/sync-wave: "-1" ---- -apiVersion: v1 -kind: Namespace -metadata: - name: kustomize-guestbook - annotations: - argocd.argoproj.io/sync-wave: "-1" ---- -apiVersion: v1 -kind: Namespace -metadata: - name: sync-waves - annotations: - argocd.argoproj.io/sync-wave: "-1" diff --git a/apps/templates/sync-waves.yaml b/apps/templates/sync-waves.yaml deleted file mode 100644 index 24dbc9b..0000000 --- a/apps/templates/sync-waves.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: sync-waves - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - destination: - namespace: sync-waves - server: {{ .Values.spec.destination.server }} - project: default - source: - path: sync-waves - repoURL: {{ .Values.spec.source.repoURL }} - targetRevision: {{ .Values.spec.source.targetRevision }} diff --git a/apps/values.yaml b/apps/values.yaml index cd66cc0..bdf16da 100644 --- a/apps/values.yaml +++ b/apps/values.yaml @@ -1,6 +1,31 @@ -spec: - destination: - server: https://kubernetes.default.svc - source: - repoURL: https://github.com/argoproj/argocd-example-apps - targetRevision: HEAD \ No newline at end of file +config: + spec: + destination: + server: https://kubernetes.default.svc + source: + repoURL: https://github.com/argoproj/argocd-example-apps + targetRevision: HEAD + +applications: + - name: blue-green + - name: guestbook + - name: helm-dependency + - name: helm-guestbook + - name: helm-hooks + - name: jsonnet-guestbook + - name: jsonnet-guestbook-tla + - name: ksonnet-guestbook + - name: kustomize-guestbook + - name: plugin-kasane + path: plugins/kasane + tool: + plugin: + name: kasane + - name: plugin-kustomized-helm + path: plugins/kustomized-helm + tool: + plugin: + name: kustomized-helm + - name: pre-post-sync + - name: sock-shop + - name: sync-waves