Browse Source

Suggestion to consolidate application templates into one

Signed-off-by: ranrubin <ranrubin@gmail.com>
pull/140/head
ranrubin 3 years ago
parent
commit
1d9b9e91c0
  1. 35
      apps/templates/applications.yaml
  2. 16
      apps/templates/helm-guestbook.yaml
  3. 17
      apps/templates/helm-hooks.yaml
  4. 16
      apps/templates/kustomize-guestbook.yaml
  5. 16
      apps/templates/sync-waves.yaml
  6. 13
      apps/values-production.yaml
  7. 35
      apps/values.yaml

35
apps/templates/applications.yaml

@ -0,0 +1,35 @@
{{- range $app := .Values.argocdApplications -}}
{{ if not .disable }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ .name }}
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: {{ $.Values.global.spec.project }}
source:
repoURL: {{ $.Values.global.spec.source.repoURL }}
targetRevision: {{ default $.Values.global.spec.source.targetRevision .targetRevision }}
path: {{ .name }}
{{- if default $.Values.global.helmDefault .helm }}
helm:
valueFiles:
- {{ $.Values.global.valuesFile }}
{{- end }}
destination:
namespace: {{ default $.Values.global.spec.destination.namespace .namespace }}
server: {{ $.Values.global.spec.destination.server }}
syncPolicy:
{{- if not .disableAutomated }}
automated:
prune: false
selfHeal: true
allowEmpty: false
{{- end }}
syncOptions:
- CreateNamespace=true
---
{{- end }}
{{- end }}

16
apps/templates/helm-guestbook.yaml

@ -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 }}

17
apps/templates/helm-hooks.yaml

@ -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 }}

16
apps/templates/kustomize-guestbook.yaml

@ -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 }}

16
apps/templates/sync-waves.yaml

@ -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 }}

13
apps/values-production.yaml

@ -0,0 +1,13 @@
global:
env: production
valuesFile: values-production.yaml
spec:
project: default
argocdApplications:
helmGuestbook:
targetRevision: 1.0.0
kustomizeGuestbook:
disable: true
syncWaves:
disableAutomated: true

35
apps/values.yaml

@ -1,6 +1,39 @@
spec: global:
env: development
helmDefault: false
valuesFile: values.yaml
spec:
project: default
destination: destination:
server: https://kubernetes.default.svc server: https://kubernetes.default.svc
namespace: default
source: source:
repoURL: https://github.com/argoproj/argocd-example-apps repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: HEAD targetRevision: HEAD
argocdApplications:
helmGuestbook:
disableAutomated: false
disable: false
name: helm-guestbook
namespace: helm-guestbook
helm: true
# targetRevision: HEAD
helmHooks:
disableAutomated: false
disable: false
name: helm-hooks
namespace: helm-hooks
# targetRevision: HEAD
kustomizeGuestbook:
disableAutomated: false
disable: false
name: kustomize-guestbook
namespace: kustomize-guestbook
# targetRevision: HEAD
syncWaves:
disableAutomated: false
disable: false
name: sync-waves
namespace: sync-waves
# targetRevision: HEAD
Loading…
Cancel
Save