Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argocd-apps #16

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
*/ -}}