diff --git a/apps/templates/applications.yaml b/apps/templates/applications.yaml new file mode 100644 index 0000000..b381706 --- /dev/null +++ b/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 }} \ No newline at end of file diff --git a/apps/templates/helm-guestbook.yaml b/apps/templates/helm-guestbook.yaml deleted file mode 100644 index e1e5a8b..0000000 --- a/apps/templates/helm-guestbook.yaml +++ /dev/null @@ -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 }} diff --git a/apps/templates/helm-hooks.yaml b/apps/templates/helm-hooks.yaml deleted file mode 100644 index 5f65a8d..0000000 --- a/apps/templates/helm-hooks.yaml +++ /dev/null @@ -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 }} - diff --git a/apps/templates/kustomize-guestbook.yaml b/apps/templates/kustomize-guestbook.yaml deleted file mode 100644 index 7a36476..0000000 --- a/apps/templates/kustomize-guestbook.yaml +++ /dev/null @@ -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 }} diff --git a/apps/templates/sync-waves.yaml b/apps/templates/sync-waves.yaml deleted file mode 100644 index 24dbc9b..0000000 --- a/apps/templates/sync-waves.yaml +++ /dev/null @@ -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 }} diff --git a/apps/values-production.yaml b/apps/values-production.yaml new file mode 100644 index 0000000..7308fea --- /dev/null +++ b/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 diff --git a/apps/values.yaml b/apps/values.yaml index cd66cc0..52cc2c4 100644 --- a/apps/values.yaml +++ b/apps/values.yaml @@ -1,6 +1,39 @@ -spec: - destination: - server: https://kubernetes.default.svc - source: - repoURL: https://github.com/argoproj/argocd-example-apps - targetRevision: HEAD \ No newline at end of file +global: + env: development + helmDefault: false + valuesFile: values.yaml + spec: + project: default + destination: + server: https://kubernetes.default.svc + namespace: default + source: + repoURL: https://github.com/argoproj/argocd-example-apps + 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 \ No newline at end of file