diff --git a/charts/argocd-apps/ci/application-templates-string.yaml b/charts/argocd-apps/ci/application-templates-string.yaml deleted file mode 100644 index a4adfa9b..00000000 --- a/charts/argocd-apps/ci/application-templates-string.yaml +++ /dev/null @@ -1,28 +0,0 @@ -applicationTemplates: - - apps: - - name: guestbook - project: guestbook-project - template: |- - apiVersion: argoproj.io/v1alpha1 - kind: Application - metadata: - name: {{ .name }} - # You'll usually want to add your resources to the argocd namespace. - namespace: argocd - # Add this finalizer ONLY if you want these to cascade delete. - finalizers: - - resources-finalizer.argocd.argoproj.io - # Add labels to your application object. - labels: - name: guestbook - spec: - # The project the application belongs to. - project: {{ .project }} - - # Source of the application manifests - source: - repoURL: https://github.com/argoproj/argocd-example-apps.git - targetRevision: HEAD - path: guestbook - directory: - recurse: true \ No newline at end of file diff --git a/charts/argocd-apps/ci/application-templates-yaml.yaml b/charts/argocd-apps/ci/application-templates-yaml.yaml deleted file mode 100644 index 26bbdd62..00000000 --- a/charts/argocd-apps/ci/application-templates-yaml.yaml +++ /dev/null @@ -1,28 +0,0 @@ -applicationTemplates: - - apps: - - name: guestbook - project: guestbook-project - template: - apiVersion: argoproj.io/v1alpha1 - kind: Application - metadata: - name: "{{ .name }}" - # You'll usually want to add your resources to the argocd namespace. - namespace: argocd - # Add this finalizer ONLY if you want these to cascade delete. - finalizers: - - resources-finalizer.argocd.argoproj.io - # Add labels to your application object. - labels: - name: guestbook - spec: - # The project the application belongs to. - project: "{{ .project }}" - - # Source of the application manifests - source: - repoURL: https://github.com/argoproj/argocd-example-apps.git - targetRevision: HEAD - path: guestbook - directory: - recurse: true \ No newline at end of file diff --git a/charts/argocd-apps/ci/applicationset-templates-string.yaml b/charts/argocd-apps/ci/applicationset-templates-string.yaml deleted file mode 100644 index a18c099c..00000000 --- a/charts/argocd-apps/ci/applicationset-templates-string.yaml +++ /dev/null @@ -1,31 +0,0 @@ -applicationsetTemplates: - - appSets: - - name: my-appset - generators: - - list: - elements: - - cluster: engineering-dev - url: https://1.2.3.4 - - cluster: engineering-prod - url: https://2.4.6.8 - - cluster: finance-preprod - url: https://9.8.7.6 - template: |- - apiVersion: argoproj.io/v1alpha1 - kind: ApplicationSet - metadata: - name: {{ .name }} - spec: - generators: {{ toYaml .generators | nindent 4 }} - template: - metadata: - name: '{{`{{cluster}}`}}-guestbook' - spec: - project: my-project - source: - repoURL: https://github.com/infra-team/cluster-deployments.git - targetRevision: HEAD - path: guestbook/{{`{{cluster}}`}} - destination: - server: '{{`{{cluster}}`}}' - namespace: guestbook \ No newline at end of file diff --git a/charts/argocd-apps/ci/applicationset-templates-yaml.yaml b/charts/argocd-apps/ci/applicationset-templates-yaml.yaml deleted file mode 100644 index 067897fc..00000000 --- a/charts/argocd-apps/ci/applicationset-templates-yaml.yaml +++ /dev/null @@ -1,31 +0,0 @@ -applicationsetTemplates: - - appSets: - - name: my-appset - generators: - - list: - elements: - - cluster: engineering-dev - url: https://1.2.3.4 - - cluster: engineering-prod - url: https://2.4.6.8 - - cluster: finance-preprod - url: https://9.8.7.6 - template: - apiVersion: argoproj.io/v1alpha1 - kind: ApplicationSet - metadata: - name: "{{ .name }}" - spec: - generators: "{{ toYaml .generators | nindent 4 }}" - template: - metadata: - name: '{{`{{cluster}}`}}-guestbook' - spec: - project: my-project - source: - repoURL: https://github.com/infra-team/cluster-deployments.git - targetRevision: HEAD - path: guestbook/{{`{{cluster}}`}} - destination: - server: '{{`{{cluster}}`}}' - namespace: guestbook \ No newline at end of file diff --git a/charts/argocd-apps/ci/item-templates.yaml b/charts/argocd-apps/ci/item-templates.yaml new file mode 100644 index 00000000..8a08c684 --- /dev/null +++ b/charts/argocd-apps/ci/item-templates.yaml @@ -0,0 +1,61 @@ +itemTemplates: + - items: + - name: my-appset + generators: &generators + - list: + elements: + - cluster: engineering-dev + url: https://1.2.3.4 + - cluster: engineering-prod + url: https://2.4.6.8 + - cluster: finance-preprod + url: https://9.8.7.6 + template: + apiVersion: argoproj.io/v1alpha1 + kind: ApplicationSet + metadata: + name: "{{ .name }}" + spec: + generators: *generators + template: + metadata: + name: "{{`{{cluster}}`}}-guestbook" + spec: + project: my-project + source: + repoURL: https://github.com/infra-team/cluster-deployments.git + targetRevision: HEAD + path: guestbook/{{`{{cluster}}`}} + destination: + server: "{{`{{cluster}}`}}" + namespace: guestbook + - items: + - name: my-appset + generators: + - list: + elements: + - cluster: engineering-dev + url: https://1.2.3.4 + - cluster: engineering-prod + url: https://2.4.6.8 + - cluster: finance-preprod + url: https://9.8.7.6 + template: |- + apiVersion: argoproj.io/v1alpha1 + kind: ApplicationSet + metadata: + name: {{ .name }} + spec: + generators: {{ toYaml .generators | nindent 4 }} + template: + metadata: + name: '{{`{{cluster}}`}}-guestbook' + spec: + project: my-project + source: + repoURL: https://github.com/infra-team/cluster-deployments.git + targetRevision: HEAD + path: guestbook/{{`{{cluster}}`}} + destination: + server: '{{`{{cluster}}`}}' + namespace: guestbook diff --git a/charts/argocd-apps/ci/project-template-string.yaml b/charts/argocd-apps/ci/project-template-string.yaml deleted file mode 100644 index aea4eb57..00000000 --- a/charts/argocd-apps/ci/project-template-string.yaml +++ /dev/null @@ -1,27 +0,0 @@ -projectTemplates: - - projects: - - name: my-project - namespace: my-namespace - template: |- - apiVersion: argoproj.io/v1alpha1 - kind: AppProject - metadata: - name: {{ .name }} - namespace: argocd - # Finalizer that ensures that project is not deleted until it is not referenced by any application - finalizers: - - resources-finalizer.argocd.argoproj.io - spec: - # Project description - description: Example Project - - # Allow manifests to deploy from any Git repos - sourceRepos: - - '*' - - # Only permit applications to deploy to the guestbook namespace in the same cluster - # Destination clusters can be identified by 'server', 'name', or both. - destinations: - - namespace: {{ .namespace }} - server: https://kubernetes.default.svc - name: in-cluster diff --git a/charts/argocd-apps/ci/project-template-yaml.yaml b/charts/argocd-apps/ci/project-template-yaml.yaml deleted file mode 100644 index 41516bb0..00000000 --- a/charts/argocd-apps/ci/project-template-yaml.yaml +++ /dev/null @@ -1,27 +0,0 @@ -projectTemplates: - - projects: - - name: my-project - namespace: my-namespace - template: - apiVersion: argoproj.io/v1alpha1 - kind: AppProject - metadata: - name: "{{ .name }}" - namespace: argocd - # Finalizer that ensures that project is not deleted until it is not referenced by any application - finalizers: - - resources-finalizer.argocd.argoproj.io - spec: - # Project description - description: Example Project - - # Allow manifests to deploy from any Git repos - sourceRepos: - - "*" - - # Only permit applications to deploy to the guestbook namespace in the same cluster - # Destination clusters can be identified by 'server', 'name', or both. - destinations: - - namespace: "{{ .namespace }}" - server: https://kubernetes.default.svc - name: in-cluster diff --git a/charts/argocd-apps/templates/applications.yaml b/charts/argocd-apps/templates/applications.yaml index cfde1f37..48136179 100644 --- a/charts/argocd-apps/templates/applications.yaml +++ b/charts/argocd-apps/templates/applications.yaml @@ -49,17 +49,17 @@ spec: {{- toYaml . | nindent 4 }} {{- end }} {{- end }} ---- -{{- range .Values.applicationTemplates }} + +{{- range .Values.itemTemplates }} {{- if kindIs "string" .template }} {{- $template := .template -}} -{{- range .apps }} +{{- range .items }} --- {{ tpl $template (set . "Template" $.Template) }} {{- end }} {{- else }} {{- $template := .template | toYaml -}} -{{- range .apps }} +{{- range .items }} --- {{ tpl $template (set . "Template" $.Template) }} {{- end }} diff --git a/charts/argocd-apps/templates/applicationsets.yaml b/charts/argocd-apps/templates/applicationsets.yaml index 293b3471..bb8b09d1 100644 --- a/charts/argocd-apps/templates/applicationsets.yaml +++ b/charts/argocd-apps/templates/applicationsets.yaml @@ -77,19 +77,3 @@ spec: {{- end -}} {{- end }} {{- end }} ---- -{{- range .Values.applicationsetTemplates }} -{{- if kindIs "string" .template }} -{{- $template := .template -}} -{{- range .appSets }} ---- -{{ tpl $template (set . "Template" $.Template) }} -{{- end }} -{{- else }} -{{- $template := .template | toYaml -}} -{{- range .appSets }} ---- -{{ tpl $template (set . "Template" $.Template) }} -{{- end }} -{{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/argocd-apps/templates/projects.yaml b/charts/argocd-apps/templates/projects.yaml index 8b2d2052..f747d1b6 100644 --- a/charts/argocd-apps/templates/projects.yaml +++ b/charts/argocd-apps/templates/projects.yaml @@ -68,18 +68,3 @@ spec: {{- toYaml . | nindent 4 }} {{- end }} {{- end }} -{{- range .Values.projectTemplates }} -{{- if kindIs "string" .template }} -{{- $template := .template -}} -{{- range .projects }} ---- -{{ tpl $template (set . "Template" $.Template) }} -{{- end }} -{{- else }} -{{- $template := .template | toYaml -}} -{{- range .projects }} ---- -{{ tpl $template (set . "Template" $.Template) }} -{{- end }} -{{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/argocd-apps/values.yaml b/charts/argocd-apps/values.yaml index 89079821..d25193da 100644 --- a/charts/argocd-apps/values.yaml +++ b/charts/argocd-apps/values.yaml @@ -40,43 +40,6 @@ applications: [] # - name: url # value: https://argoproj.github.io/ -applicationTemplates: [] -# - apps: -# - name: guestbook -# project: guestbook-project -# template: |- -# apiVersion: argoproj.io/v1alpha1 -# kind: Application -# metadata: -# name: {{ .name }} -# # You'll usually want to add your resources to the argocd namespace. -# namespace: argocd -# # Add this finalizer ONLY if you want these to cascade delete. -# finalizers: -# - resources-finalizer.argocd.argoproj.io -# # Add labels to your application object. -# labels: -# name: guestbook -# spec: -# # The project the application belongs to. -# project: {{ .project }} -# # Source of the application manifests -# source: -# repoURL: https://github.com/argoproj/argocd-example-apps.git # Can point to either a Helm chart repo or a git repo. -# targetRevision: HEAD # For Helm, this refers to the chart version. -# path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git. -# # helm specific config -# chart: chart-name # Set this when pulling directly from a Helm repo. DO NOT set for git-hosted Helm charts. -# helm: -# passCredentials: false # If true then adds --pass-credentials to Helm commands to pass credentials to all domains -# # Extra parameters to set (same as setting through values.yaml, but these take precedence) -# parameters: -# - name: "nginx-ingress.controller.service.annotations.external-dns\\.alpha\\.kubernetes\\.io/hostname" -# value: mydomain.example.com -# - name: "ingress.annotations.kubernetes\\.io/tls-acme" -# value: "true" -# forceString: true # ensures that value is treated as a string - # -- Deploy Argo CD Projects within this helm release # @default -- `[]` (See [values.yaml]) ## Ref: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/ @@ -123,31 +86,6 @@ projects: [] # sourceNamespaces: # - argocd -projectTemplates: [] -# - projects: -# - name: my-project -# namespace: my-namespace -# template: |- -# apiVersion: argoproj.io/v1alpha1 -# kind: AppProject -# metadata: -# name: {{ .name }} -# namespace: argocd -# # Finalizer that ensures that project is not deleted until it is not referenced by any application -# finalizers: -# - resources-finalizer.argocd.argoproj.io -# spec: -# # Project description -# description: Example Project -# # Allow manifests to deploy from any Git repos -# sourceRepos: -# - '*' -# # Only permit applications to deploy to the guestbook namespace in the same cluster -# # Destination clusters can be identified by 'server', 'name', or both. -# destinations: -# - namespace: {{ .namespace }} -# server: https://kubernetes.default.svc -# name: in-cluster # -- Deploy Argo CD ApplicationSets within this helm release # @default -- `[]` (See [values.yaml]) ## Ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/ @@ -195,18 +133,48 @@ applicationsets: [] # # Set Application finalizer # preserveResourcesOnDeletion: false -applicationsetTemplates: [] -# - appSets: +itemTemplates: [] +# - items: +# - name: my-appset +# generators: &generators +# - list: +# elements: +# - cluster: engineering-dev +# url: https://1.2.3.4 +# - cluster: engineering-prod +# url: https://2.4.6.8 +# - cluster: finance-preprod +# url: https://9.8.7.6 +# template: +# apiVersion: argoproj.io/v1alpha1 +# kind: ApplicationSet +# metadata: +# name: "{{ .name }}" +# spec: +# generators: *generators +# template: +# metadata: +# name: "{{`{{cluster}}`}}-guestbook" +# spec: +# project: my-project +# source: +# repoURL: https://github.com/infra-team/cluster-deployments.git +# targetRevision: HEAD +# path: guestbook/{{`{{cluster}}`}} +# destination: +# server: "{{`{{cluster}}`}}" +# namespace: guestbook +# - items: # - name: my-appset # generators: # - list: # elements: -# - cluster: engineering-dev -# url: https://1.2.3.4 -# - cluster: engineering-prod -# url: https://2.4.6.8 -# - cluster: finance-preprod -# url: https://9.8.7.6 +# - cluster: engineering-dev +# url: https://1.2.3.4 +# - cluster: engineering-prod +# url: https://2.4.6.8 +# - cluster: finance-preprod +# url: https://9.8.7.6 # template: |- # apiVersion: argoproj.io/v1alpha1 # kind: ApplicationSet @@ -216,16 +184,17 @@ applicationsetTemplates: [] # generators: {{ toYaml .generators | nindent 4 }} # template: # metadata: -# name: '{{`{{cluster}}`}}-guestbook' +# name: '{{`{{cluster}}`}}-guestbook' # spec: -# project: my-project -# source: +# project: my-project +# source: # repoURL: https://github.com/infra-team/cluster-deployments.git # targetRevision: HEAD # path: guestbook/{{`{{cluster}}`}} -# destination: +# destination: # server: '{{`{{cluster}}`}}' # namespace: guestbook + # -- Deploy Argo UI Extensions within this helm release # @default -- `[]` (See [values.yaml]) ## This function in tech preview stage, do expect unstability or breaking changes in newer versions. Bump image.tag if necessary.