diff --git a/charts/app/Chart.yaml b/charts/app/Chart.yaml index d4a6f44..7a8fbb8 100644 --- a/charts/app/Chart.yaml +++ b/charts/app/Chart.yaml @@ -3,7 +3,7 @@ name: app description: A Helm chart for Kubernetes Deployment type: application -version: 0.13.6 +version: 0.13.7 keywords: - deployment diff --git a/charts/argo-applications/Chart.yaml b/charts/argo-applications/Chart.yaml index 5c4cdfc..7547fec 100644 --- a/charts/argo-applications/Chart.yaml +++ b/charts/argo-applications/Chart.yaml @@ -3,7 +3,7 @@ name: argo-applications description: A Helm chart for Kubernetes argo applications type: application -version: 0.13.6 +version: 0.13.7 keywords: - argocd diff --git a/charts/argo-applications/templates/applications.yaml b/charts/argo-applications/templates/applications.yaml index e72d0d2..a0e6590 100644 --- a/charts/argo-applications/templates/applications.yaml +++ b/charts/argo-applications/templates/applications.yaml @@ -1,9 +1,9 @@ -{{- if .Values.server.additionalApplications }} -{{- $appDefaults := .Values.server.additionalApplicationsDefaults -}} +{{- if .Values.applications }} +{{- $appDefaults := .Values.applicationsDefaults -}} apiVersion: v1 kind: List items: -{{- range $appValuesOrig := .Values.server.additionalApplications }} +{{- range $appValuesOrig := .Values.applications }} {{- $appValues := mergeOverwrite (dict) (deepCopy $appDefaults) $appValuesOrig }} - apiVersion: argoproj.io/v1alpha1 kind: Application @@ -14,31 +14,44 @@ items: {{ $key }}: {{ $value | quote }} {{- end }} {{- end }} - {{- if $appValues.additionalLabels }} + {{- with $appValues.additionalLabels }} labels: -{{- toYaml $appValues.additionalLabels | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} name: {{ .name }} {{- if $appValues.namespace }} namespace: {{ $appValues.namespace }} {{- end }} - {{- if $appValues.finalizers }} + {{- with $appValues.finalizers }} finalizers: -{{- toYaml $appValues.finalizers | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} spec: project: {{ tpl $appValues.project $ }} + {{- with $appValues.source }} source: -{{- toYaml $appValues.source | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $appValues.sources }} + sources: + {{- toYaml . | nindent 8 }} + {{- end }} destination: -{{- toYaml $appValues.destination | nindent 8 }} - {{- if $appValues.syncPolicy }} + {{- toYaml $appValues.destination | nindent 4 }} + {{- with $appValues.syncPolicy }} syncPolicy: -{{- toYaml $appValues.syncPolicy | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} - {{- if $appValues.ignoreDifferences }} + {{- with $appValues.revisionHistoryLimit }} + revisionHistoryLimit: {{ . }} + {{- end }} + {{- with $appValues.ignoreDifferences }} ignoreDifferences: -{{- toYaml $appValues.ignoreDifferences | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $appValues.info }} + info: + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/argo-applications/templates/applicationsets.yaml b/charts/argo-applications/templates/applicationsets.yaml new file mode 100644 index 0000000..4a4eb86 --- /dev/null +++ b/charts/argo-applications/templates/applicationsets.yaml @@ -0,0 +1,91 @@ + +{{- range .Values.applicationsets }} +--- +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + {{- with .additionalAnnotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + {{- with .additionalLabels }} + labels: + {{- toYaml . | nindent 4 }} + {{- end }} + name: {{ .name }} + {{- with .namespace }} + namespace: {{ . }} + {{- end }} +spec: + {{- if hasKey . "goTemplate" }} + goTemplate: {{ .goTemplate }} + {{- end }} + {{- with .generators }} + generators: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .ignoreApplicationDifferences }} + ignoreApplicationDifferences: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .strategy }} + strategy: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .syncPolicy }} + syncPolicy: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .template }} + template: + {{- with .metadata }} + metadata: + {{- with .annotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ $value | squote }} + {{- end }} + {{- end }} + {{- with .labels }} + labels: + {{- toYaml . | nindent 8 }} + {{- end }} + name: {{ .name | squote }} + {{- with .namespace }} + namespace: {{ . | squote }} + {{- end }} + {{- end }} + {{- with .spec }} + spec: + project: {{ .project | squote }} + {{- with .source }} + source: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .sources }} + sources: + {{- toYaml . | nindent 8 }} + {{- end }} + destination: + {{- toYaml .destination | nindent 8 }} + {{- with .syncPolicy }} + syncPolicy: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .ignoreDifferences }} + ignoreDifferences: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .info }} + info: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end -}} + {{- end }} + {{- with .templatePatch }} + templatePatch: | + {{- . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/argo-applications/templates/extensions.yaml b/charts/argo-applications/templates/extensions.yaml new file mode 100644 index 0000000..31fe9c0 --- /dev/null +++ b/charts/argo-applications/templates/extensions.yaml @@ -0,0 +1,27 @@ +{{- range .Values.extensions }} +--- +apiVersion: argoproj.io/v1alpha1 +kind: ArgoCDExtension +metadata: + name: {{ .name }} + {{- with .namespace }} + namespace: {{ . }} + {{- end }} + finalizers: + - extensions-finalizer.argocd.argoproj.io + {{- with .additionalLabels }} + labels: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .additionalAnnotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} +{{- with .sources }} +spec: + sources: + {{- toYaml . | nindent 4 }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/argo-applications/templates/item-templates.yaml b/charts/argo-applications/templates/item-templates.yaml new file mode 100644 index 0000000..a209cc2 --- /dev/null +++ b/charts/argo-applications/templates/item-templates.yaml @@ -0,0 +1,15 @@ +{{- range .Values.itemTemplates }} +{{- if kindIs "string" .template }} +{{- $template := .template -}} +{{- range .items }} +--- +{{ tpl $template (set . "Template" $.Template) }} +{{- end }} +{{- else }} +{{- $template := .template | toYaml -}} +{{- range .items }} +--- +{{ tpl $template (set . "Template" $.Template) }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/argo-applications/templates/projects.yaml b/charts/argo-applications/templates/projects.yaml index 73ec79c..9be52a1 100644 --- a/charts/argo-applications/templates/projects.yaml +++ b/charts/argo-applications/templates/projects.yaml @@ -1,54 +1,73 @@ -{{- if .Values.server.additionalProjects }} -apiVersion: v1 -kind: List -items: -{{- range .Values.server.additionalProjects }} - - apiVersion: argoproj.io/v1alpha1 - kind: AppProject - metadata: - {{- if .additionalAnnotations }} - annotations: - {{- range $key, $value := .additionalAnnotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} - {{- end }} - {{- if .additionalLabels }} - labels: -{{- toYaml .additionalLabels | nindent 8 }} - {{- end }} - name: {{ .name }} - {{- if .namespace }} - namespace: {{ .namespace }} - {{- end }} - spec: - description: {{ .description }} - sourceRepos: -{{- toYaml .sourceRepos | nindent 8 }} - destinations: -{{- toYaml .destinations | nindent 8 }} - {{- if .clusterResourceWhitelist }} - clusterResourceWhitelist: -{{- toYaml .clusterResourceWhitelist | nindent 8 }} - {{- end }} - {{- if .namespaceResourceBlacklist }} - namespaceResourceBlacklist: -{{- toYaml .namespaceResourceBlacklist | nindent 8 }} - {{- end }} - {{- if .namespaceResourceWhitelist }} - namespaceResourceWhitelist: -{{- toYaml .namespaceResourceWhitelist | nindent 8 }} - {{- end }} - {{- if .orphanedResources }} - orphanedResources: -{{- toYaml .orphanedResources | nindent 8 }} - {{- end }} - {{- if .roles }} - roles: -{{- toYaml .roles | nindent 8 }} - {{- end }} - {{- if .syncWindows }} - syncWindows: -{{- toYaml .syncWindows | nindent 8 }} - {{- end }} -{{- end }} +{{- range .Values.projects }} +--- +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + {{- with .additionalAnnotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + {{- with .additionalLabels }} + labels: + {{- toYaml . | nindent 4 }} + {{- end }} + name: {{ .name }} + {{- with .namespace }} + namespace: {{ . }} + {{- end }} + {{- with .finalizers }} + finalizers: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- with .permitOnlyProjectScopedClusters }} + permitOnlyProjectScopedClusters: {{ . }} + {{- end }} + description: {{ .description }} + {{- with .sourceRepos }} + sourceRepos: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .destinations }} + destinations: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .clusterResourceWhitelist }} + clusterResourceWhitelist: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .clusterResourceBlacklist }} + clusterResourceBlacklist: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .namespaceResourceBlacklist }} + namespaceResourceBlacklist: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .namespaceResourceWhitelist }} + namespaceResourceWhitelist: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .orphanedResources }} + orphanedResources: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .roles }} + roles: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .syncWindows }} + syncWindows: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .signatureKeys }} + signatureKeys: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .sourceNamespaces }} + sourceNamespaces: + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/argo-applications/values.yaml b/charts/argo-applications/values.yaml index 63b1aa4..a456fca 100644 --- a/charts/argo-applications/values.yaml +++ b/charts/argo-applications/values.yaml @@ -1,2 +1,255 @@ -server: - additionalApplicationsDefaults: {} +applicationsDefaults: {} + +# -- Deploy Argo CD Applications within this helm release +# @default -- `[]` (See [values.yaml]) +## Ref: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/ +applications: [] +# - name: guestbook +# namespace: argocd +# additionalLabels: {} +# additionalAnnotations: {} +# finalizers: +# - resources-finalizer.argocd.argoproj.io +# project: guestbook +# source: +# repoURL: https://github.com/argoproj/argocd-example-apps.git +# targetRevision: HEAD +# path: guestbook +# directory: +# recurse: true +# # ArgoCD v2.6 or later +# sources: +# - chart: elasticsearch +# repoURL: https://helm.elastic.co +# targetRevision: 8.5.1 +# - repoURL: https://github.com/argoproj/argocd-example-apps.git +# path: guestbook +# targetRevision: HEAD +# destination: +# server: https://kubernetes.default.svc +# namespace: guestbook +# syncPolicy: +# automated: +# prune: false +# selfHeal: false +# syncOptions: +# - CreateNamespace=true +# revisionHistoryLimit: null +# ignoreDifferences: +# - group: apps +# kind: Deployment +# jsonPointers: +# - /spec/replicas +# info: +# - name: url +# value: https://argoproj.github.io/ + +# -- Deploy Argo CD Projects within this helm release +# @default -- `[]` (See [values.yaml]) +## Ref: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/ +projects: [] +# - name: guestbook +# namespace: argocd +# additionalLabels: {} +# additionalAnnotations: {} +# permitOnlyProjectScopedClusters: false +# finalizers: +# - resources-finalizer.argocd.argoproj.io +# description: Example Project +# sourceRepos: +# - '*' +# destinations: +# - namespace: guestbook +# server: https://kubernetes.default.svc +# clusterResourceWhitelist: [] +# clusterResourceBlacklist: [] +# namespaceResourceBlacklist: +# - group: '' +# kind: ResourceQuota +# - group: '' +# kind: LimitRange +# - group: '' +# kind: NetworkPolicy +# orphanedResources: {} +# roles: [] +# namespaceResourceWhitelist: +# - group: 'apps' +# kind: Deployment +# - group: 'apps' +# kind: StatefulSet +# orphanedResources: {} +# roles: [] +# syncWindows: +# - kind: allow +# schedule: '10 1 * * *' +# duration: 1h +# applications: +# - '*-prod' +# manualSync: true +# signatureKeys: +# - keyID: ABCDEF1234567890 +# sourceNamespaces: +# - argocd + +# -- Deploy Argo CD ApplicationSets within this helm release +# @default -- `[]` (See [values.yaml]) +## Ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/ +applicationsets: [] +# - name: guestbook +# namespace: argocd +# additionalLabels: {} +# additionalAnnotations: {} +# # See PR #10026 (ArgoCD v2.5 or later) +# # goTemplate: false +# generators: +# - git: +# repoURL: https://github.com/argoproj/argocd-example-apps.git +# revision: HEAD +# directories: +# - path: guestbook +# - path: kustomize-* +# # Ref https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Controlling-Resource-Modification/#allow-temporarily-toggling-auto-sync +# ignoreApplicationDifferences: +# - jsonPointers: +# - /spec/syncPolicy +# # Progressive Syncs is an experimental feature and it must be explicitly enabled +# # Ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Progressive-Syncs/#enabling-progressive-syncs +# strategy: +# type: RollingSync +# rollingSync: +# steps: +# - matchExpressions: +# - key: project +# operator: In +# values: +# - guestbook +# - matchExpressions: +# - key: project +# operator: In +# values: +# - kustomize-foo +# - kustomize-bar +# template: +# metadata: +# name: '{{path.basename}}' +# labels: +# project: '{{path.basename}}' +# annotations: {} +# spec: +# project: default +# source: +# repoURL: https://github.com/argoproj/argocd-example-apps.git +# targetRevision: HEAD +# path: '{{path}}' +# destination: +# server: https://kubernetes.default.svc +# namespace: default +# syncPolicy: +# automated: +# prune: false +# selfHeal: false +# ignoreDifferences: +# - group: apps +# kind: Deployment +# jsonPointers: +# - /spec/replicas +# info: +# - name: url +# value: https://argoproj.github.io/ +# syncPolicy: +# # Set Application finalizer +# preserveResourcesOnDeletion: false +# # Templating is only available on string type +# templatePatch: | +# spec: +# source: +# helm: +# valueFiles: +# {{- range $valueFile := .valueFiles }} +# - {{ $valueFile }} +# {{- end }} +# {{- if .autoSync }} +# syncPolicy: +# automated: +# prune: {{ .prune }} +# {{- end }} + +# -- Deploy Argo CD Applications/ApplicationSets/Projects within this helm release +# @default -- `[]` (See [values.yaml]) +## Ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/ +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 + +# -- DEPRECATED - Please refer [Deprecation Notice](https://github.com/argoproj-labs/argocd-extensions?tab=readme-ov-file#deprecation-notice) for more info. +# @default -- `[]` (See [values.yaml]) +## This function in tech preview stage, do expect unstability or breaking changes in newer versions. Bump image.tag if necessary. +## Ref: https://github.com/argoproj-labs/argocd-extensions +extensions: [] + # - name: example + # namespace: argocd + # additionalLabels: {} + # additionalAnnotations: {} + # sources: + # - git: + # url: https://github.com/argoproj-labs/argocd-example-extension.git + # - web: + # url: https://github.com/argoproj-labs/argocd-example-extension/releases/download/v0.1.0/extension.tar \ No newline at end of file diff --git a/charts/base/Chart.yaml b/charts/base/Chart.yaml index 0ad3274..957fb6d 100644 --- a/charts/base/Chart.yaml +++ b/charts/base/Chart.yaml @@ -3,7 +3,7 @@ name: base description: A Helm chart for Kubernetes with helm named templates type: library -version: 0.13.6 +version: 0.13.7 keywords: - deployment diff --git a/charts/cronjob/Chart.yaml b/charts/cronjob/Chart.yaml index 0cd3338..99f2529 100644 --- a/charts/cronjob/Chart.yaml +++ b/charts/cronjob/Chart.yaml @@ -3,7 +3,7 @@ name: cronjob description: A Helm chart for Kubernetes cronjob type: application -version: 0.13.6 +version: 0.13.7 keywords: - cronjob diff --git a/charts/default-base/Chart.yaml b/charts/default-base/Chart.yaml index 2fc3035..1871c58 100644 --- a/charts/default-base/Chart.yaml +++ b/charts/default-base/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: default-base description: A Helm chart for Kubernetes - default-base for namespaces -version: 0.13.6 +version: 0.13.7 keywords: - BackendConfig diff --git a/charts/ingress/Chart.yaml b/charts/ingress/Chart.yaml index 20888bd..a8f82e6 100644 --- a/charts/ingress/Chart.yaml +++ b/charts/ingress/Chart.yaml @@ -3,7 +3,7 @@ name: ingress description: A Helm chart for Kubernetes ingress type: application -version: 0.13.6 +version: 0.13.7 keywords: - ingress diff --git a/charts/job/Chart.yaml b/charts/job/Chart.yaml index 6094dc7..762d937 100644 --- a/charts/job/Chart.yaml +++ b/charts/job/Chart.yaml @@ -3,7 +3,7 @@ name: job description: A Helm chart for Kubernetes job type: application -version: 0.13.6 +version: 0.13.7 keywords: - job diff --git a/charts/prometheus-rules/Chart.yaml b/charts/prometheus-rules/Chart.yaml index bcf5381..e52e59f 100644 --- a/charts/prometheus-rules/Chart.yaml +++ b/charts/prometheus-rules/Chart.yaml @@ -3,7 +3,7 @@ name: prometheus-rules description: A Helm chart for Prometheus Rules type: application -version: 0.13.6 +version: 0.13.7 keywords: - job diff --git a/charts/rbac/Chart.yaml b/charts/rbac/Chart.yaml index 312d9c6..b017858 100644 --- a/charts/rbac/Chart.yaml +++ b/charts/rbac/Chart.yaml @@ -3,7 +3,7 @@ name: rbac description: A Helm chart for Kubernetes rbac type: application -version: 0.13.6 +version: 0.13.7 keywords: - rbac diff --git a/charts/service/Chart.yaml b/charts/service/Chart.yaml index 1f656e7..401d66a 100644 --- a/charts/service/Chart.yaml +++ b/charts/service/Chart.yaml @@ -3,7 +3,7 @@ name: service description: A Helm chart for Kubernetes service type: application -version: 0.13.6 +version: 0.13.7 keywords: - service