Skip to content

Commit

Permalink
argocd-apps (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
pli01 authored Apr 9, 2024
1 parent 4c3a830 commit 6d068b9
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 6 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 27 additions & 0 deletions argocd-apps/app-hemlfile-argocd.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion argocd-apps/app-hemlfile-loki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion argocd-apps/app-hemlfile-prometheus-stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion argocd-apps/app-hemlfile-promtail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion argocd-apps/app-hemlfile-whoami.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/ -}}

0 comments on commit 6d068b9

Please sign in to comment.