diff --git a/README.md b/README.md index f162c63..4205340 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,20 @@ Values for releases can be defined in following order: values: - "{{`{{ .Release.Name }}`}}-values.yaml.gotmpl" - "env/{{ .Environment.Name }}/{{`{{ .Release.Name }}`}}-values.yaml.gotmpl" + +Secrets can be defined in the same way ``` +### ArgoCD app of apps + +ArgoCD can deploy helmfiles with the concept of app of apps + +For this example: +- We define the git repository which contain the root apps (the apps of apps) in `helmfile.d/releases/argocd/env/local/extra-argocd-values.yaml.gotmpl` + - in this demo: argocd watch this repo and is trigger on branch `test-argocd-helmfile` +- Then, we define all Argocd Application in `argocd-apps/app-helmfile*.yaml` +- Argocd will trigger all deployment on Every commit, on the branch + ## Run it Prereq: diff --git a/argocd-apps/app-hemlfile-argocd.yaml b/argocd-apps/app-hemlfile-argocd.yaml new file mode 100644 index 0000000..d4bcbd5 --- /dev/null +++ b/argocd-apps/app-hemlfile-argocd.yaml @@ -0,0 +1,27 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: argocd + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + source: + repoURL: https://github.com/pli01/k8s-helmfiles.git + targetRevision: test-argo-helmfile + path: . + plugin: + name: helmfile-v1.0 + env: + - name: ENV_NAME + value: "local" + - name: HELMFILE_FILE + value: "helmfile.d/02-argocd.yaml" + destination: + server: https://kubernetes.default.svc + syncPolicy: + automated: {} + syncOptions: + - CreateNamespace=true + - ServerSideApply=true diff --git a/argocd-apps/app-hemlfile-loki.yaml b/argocd-apps/app-hemlfile-loki.yaml index 5a06d10..5dbe255 100644 --- a/argocd-apps/app-hemlfile-loki.yaml +++ b/argocd-apps/app-hemlfile-loki.yaml @@ -17,7 +17,7 @@ spec: - name: ENV_NAME value: "local" - name: HELMFILE_FILE - value: "helmfile.d/01-loki.yaml" + value: "helmfile.d/03-loki.yaml" destination: server: https://kubernetes.default.svc namespace: loki diff --git a/argocd-apps/app-hemlfile-prometheus-stack.yaml b/argocd-apps/app-hemlfile-prometheus-stack.yaml index 778f5ed..afa56f3 100644 --- a/argocd-apps/app-hemlfile-prometheus-stack.yaml +++ b/argocd-apps/app-hemlfile-prometheus-stack.yaml @@ -17,7 +17,7 @@ spec: - name: ENV_NAME value: "local" - name: HELMFILE_FILE - value: "helmfile.d/01-prometheus-stack.yaml" + value: "helmfile.d/03-prometheus-stack.yaml" destination: server: https://kubernetes.default.svc namespace: monitoring diff --git a/argocd-apps/app-hemlfile-promtail.yaml b/argocd-apps/app-hemlfile-promtail.yaml index 98256a4..da68d8e 100644 --- a/argocd-apps/app-hemlfile-promtail.yaml +++ b/argocd-apps/app-hemlfile-promtail.yaml @@ -17,7 +17,7 @@ spec: - name: ENV_NAME value: "local" - name: HELMFILE_FILE - value: "helmfile.d/01-promtail.yaml" + value: "helmfile.d/03-promtail.yaml" destination: server: https://kubernetes.default.svc namespace: promtail diff --git a/argocd-apps/app-hemlfile-whoami.yaml b/argocd-apps/app-hemlfile-whoami.yaml index a20df45..5cad77a 100644 --- a/argocd-apps/app-hemlfile-whoami.yaml +++ b/argocd-apps/app-hemlfile-whoami.yaml @@ -17,7 +17,7 @@ spec: - name: ENV_NAME value: "local" - name: HELMFILE_FILE - value: "helmfile.d/02-sample-apps.yaml" + value: "helmfile.d/10-sample-whoami.yaml" destination: server: https://kubernetes.default.svc namespace: whoami diff --git a/helmfile.d/10-sample-apps.yaml b/helmfile.d/10-sample-whoami.yaml similarity index 100% rename from helmfile.d/10-sample-apps.yaml rename to helmfile.d/10-sample-whoami.yaml diff --git a/helmfile.d/releases/argocd/env/local/extra-argocd-values.yaml.gotmpl b/helmfile.d/releases/argocd/env/local/extra-argocd-values.yaml.gotmpl index 07bef50..1bc6c3b 100644 --- a/helmfile.d/releases/argocd/env/local/extra-argocd-values.yaml.gotmpl +++ b/helmfile.d/releases/argocd/env/local/extra-argocd-values.yaml.gotmpl @@ -17,9 +17,11 @@ templates: path: argocd-apps repoURL: https://github.com/pli01/k8s-helmfiles.git targetRevision: test-argo-helmfile +{{- /* syncPolicy: - # disable automatic deployment - automated: {} + # automated: {} # enable automatic deployment # automated: # selfHeal: true +*/ -}} +