From 2089143fbb46857831995d75749f72b6839fd40c Mon Sep 17 00:00:00 2001 From: Asara Date: Sat, 8 Jul 2023 13:51:02 -0400 Subject: [PATCH] Test argo with argo --- argo/apps/templates/helm-apps.yaml | 34 ++++++++++++++++++++++++++++++ argo/apps/templates/root.yaml | 21 ------------------ argo/apps/values.yaml | 7 ++++++ argo/argocd/values.yaml | 19 +++++++++++++++++ argo/bootstrap.sh | 13 ++++++++++++ 5 files changed, 73 insertions(+), 21 deletions(-) create mode 100644 argo/apps/templates/helm-apps.yaml delete mode 100644 argo/apps/templates/root.yaml create mode 100644 argo/argocd/values.yaml create mode 100755 argo/bootstrap.sh diff --git a/argo/apps/templates/helm-apps.yaml b/argo/apps/templates/helm-apps.yaml new file mode 100644 index 0000000..251a8b7 --- /dev/null +++ b/argo/apps/templates/helm-apps.yaml @@ -0,0 +1,34 @@ +{{ range .Values.helmApps }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: {{ .app }} + namespace: argocd +spec: + project: default + destination: + server: https://kubernetes.default.svc + namespace: {{ .namespace }} + sources: + - repoURL: {{ .repoURL }} + chart: {{ .chart }} + targetRevision: {{ .revision }} + helm: + valueFiles: + - $values/argo/{{ .app }}/values.yaml + - repoURL: 'https://git.minhas.io/Asara/k8s.git' + targetRevision: master + ref: values + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + - ServerSideApply=true + revisionHistoryLimit: 2 + {{- if .ignoreDifferences }} + ignoreDifferences: {{- .ignoreDifferences | toYaml | trim | nindent 4 }} + {{- end }} +--- +{{ end }} diff --git a/argo/apps/templates/root.yaml b/argo/apps/templates/root.yaml deleted file mode 100644 index d65fa10..0000000 --- a/argo/apps/templates/root.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: root - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - destination: - server: https://kubernetes.default.svc - namespace: default - project: default - source: - path: argocd/apps/ - repoURL: https://git.minhas.io/asara/k8s - targetRevision: HEAD - syncPolicy: - automated: - prune: true - selfHeal: true -... diff --git a/argo/apps/values.yaml b/argo/apps/values.yaml index e69de29..eb5613d 100644 --- a/argo/apps/values.yaml +++ b/argo/apps/values.yaml @@ -0,0 +1,7 @@ +--- +helmApps: + - app: argocd + namespace: argocd + repoURL: https://argoproj.github.io/argo-helm + chart: argocd + revision: 5.37.1 diff --git a/argo/argocd/values.yaml b/argo/argocd/values.yaml new file mode 100644 index 0000000..9d57a86 --- /dev/null +++ b/argo/argocd/values.yaml @@ -0,0 +1,19 @@ +--- +redis-ha: + enabled: true + +controller: + replicas: 1 + +server: + replicas: 2 + +repoServer: + replicas: 2 + +applicationSet: + replicaCount: 2 + +configs: + params: + server.insecure: true diff --git a/argo/bootstrap.sh b/argo/bootstrap.sh new file mode 100755 index 0000000..4539779 --- /dev/null +++ b/argo/bootstrap.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +argocd app create apps \ + --dest-namespace argocd \ + --dest-server https://kubernetes.default.svc \ + --repo https://git.minhas.io/asara/k8s \ + --revision master \ + --self-heal \ + --sync-policy auto \ + --sync-option CreateNamespace=true \ + --sync-option ServerSideApply=true \ + --upsert \ + --path argo/apps +#argocd app sync apps