From 3b0ebdda661d8ff73ce2179fcf4adfdcc09c87bb Mon Sep 17 00:00:00 2001 From: Marco Kilchhofer Date: Mon, 22 Mar 2021 21:15:37 +0100 Subject: [PATCH 01/10] refactor(argo-cd): Use templating for labels (#627) Signed-off-by: Marco Kilchhofer --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/templates/_helpers.tpl | 25 ++++++++++++++++++- .../clusterrole.yaml | 7 +----- .../clusterrolebinding.yaml | 7 +----- .../deployment.yaml | 17 +++---------- .../metrics-service.yaml | 10 ++------ .../prometheusrule.yaml | 7 +----- .../argocd-application-controller/role.yaml | 7 +----- .../rolebinding.yaml | 7 +----- .../service.yaml | 10 ++------ .../serviceaccount.yaml | 7 +----- .../servicemonitor.yaml | 10 ++------ .../templates/argocd-configs/argocd-cm.yaml | 7 +----- .../argocd-configs/argocd-rbac-cm.yaml | 7 +----- .../argocd-configs/argocd-secret.yaml | 7 +----- .../argocd-ssh-known-hosts-cm.yaml | 7 +----- .../argocd-configs/argocd-tls-certs-cm.yaml | 7 +----- .../argocd-repo-server/deployment.yaml | 17 +++---------- .../templates/argocd-repo-server/hpa.yaml | 7 +----- .../argocd-repo-server/metrics-service.yaml | 10 ++------ .../repository-credentials-secret.yaml | 7 +----- .../templates/argocd-repo-server/role.yaml | 7 +----- .../argocd-repo-server/rolebinding.yaml | 7 +----- .../templates/argocd-repo-server/service.yaml | 10 ++------ .../argocd-repo-server/serviceaccount.yaml | 7 +----- .../argocd-repo-server/servicemonitor.yaml | 11 ++------ .../argocd-server/backendconfig.yaml | 7 +----- .../templates/argocd-server/certificate.yaml | 7 +----- .../templates/argocd-server/clusterrole.yaml | 7 +----- .../argocd-server/clusterrolebinding.yaml | 7 +----- .../templates/argocd-server/deployment.yaml | 17 +++---------- .../argo-cd/templates/argocd-server/hpa.yaml | 7 +----- .../templates/argocd-server/ingress-grpc.yaml | 7 +----- .../templates/argocd-server/ingress.yaml | 7 +----- .../argocd-server/metrics-service.yaml | 10 ++------ .../argo-cd/templates/argocd-server/role.yaml | 7 +----- .../templates/argocd-server/rolebinding.yaml | 7 +----- .../templates/argocd-server/route.yaml | 7 +----- .../templates/argocd-server/service.yaml | 10 ++------ .../argocd-server/serviceaccount.yaml | 7 +----- .../argocd-server/servicemonitor.yaml | 11 ++------ charts/argo-cd/templates/dex/deployment.yaml | 17 +++---------- charts/argo-cd/templates/dex/role.yaml | 7 +----- charts/argo-cd/templates/dex/rolebinding.yaml | 7 +----- charts/argo-cd/templates/dex/service.yaml | 10 ++------ .../argo-cd/templates/dex/serviceaccount.yaml | 7 +----- .../argo-cd/templates/dex/servicemonitor.yaml | 11 ++------ .../argo-cd/templates/redis/deployment.yaml | 14 ++--------- charts/argo-cd/templates/redis/service.yaml | 7 +----- 49 files changed, 92 insertions(+), 347 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index a05fa82b..7cbc9174 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 1.8.4 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 2.17.2 +version: 2.17.3 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index 8edaf216..e0810ec7 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -115,4 +115,27 @@ Create chart name and version as used by the chart label. */}} {{- define "argo-cd.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "argo-cd.labels" -}} +helm.sh/chart: {{ include "argo-cd.chart" .context }} +{{ include "argo-cd.selectorLabels" (dict "context" .context "component" .component "name" .name) }} +app.kubernetes.io/managed-by: {{ .context.Release.Service }} +app.kubernetes.io/part-of: argocd +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "argo-cd.selectorLabels" -}} +{{- if .name -}} +app.kubernetes.io/name: {{ include "argo-cd.name" .context }}-{{ .name }} +{{- end }} +app.kubernetes.io/instance: {{ .context.Release.Name }} +{{- if .component }} +app.kubernetes.io/component: {{ .component }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/argo-cd/templates/argocd-application-controller/clusterrole.yaml b/charts/argo-cd/templates/argocd-application-controller/clusterrole.yaml index 733f4571..3426c9c8 100644 --- a/charts/argo-cd/templates/argocd-application-controller/clusterrole.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/clusterrole.yaml @@ -4,12 +4,7 @@ kind: ClusterRole metadata: name: {{ template "argo-cd.controller.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} rules: - apiGroups: - '*' diff --git a/charts/argo-cd/templates/argocd-application-controller/clusterrolebinding.yaml b/charts/argo-cd/templates/argocd-application-controller/clusterrolebinding.yaml index 26580a2d..86d7c883 100644 --- a/charts/argo-cd/templates/argocd-application-controller/clusterrolebinding.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/clusterrolebinding.yaml @@ -4,12 +4,7 @@ kind: ClusterRoleBinding metadata: name: {{ template "argo-cd.controller.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml index bf4d9080..6fe98a24 100755 --- a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml @@ -4,18 +4,12 @@ kind: {{ .Values.controller.enableStatefulSet | ternary "StatefulSet" "Deploymen metadata: name: {{ template "argo-cd.controller.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.controller.image.tag | quote }} spec: selector: matchLabels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - app.kubernetes.io/instance: {{ .Release.Name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }} {{- if .Values.controller.enableStatefulSet }} serviceName: {{ template "argo-cd.controller.fullname" . }} {{- end }} @@ -30,12 +24,7 @@ spec: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 8 }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.controller.image.tag | quote }} {{- if .Values.controller.podLabels }} {{- toYaml .Values.controller.podLabels | nindent 8 }} diff --git a/charts/argo-cd/templates/argocd-application-controller/metrics-service.yaml b/charts/argo-cd/templates/argocd-application-controller/metrics-service.yaml index aa1c6f87..7331765d 100644 --- a/charts/argo-cd/templates/argocd-application-controller/metrics-service.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/metrics-service.yaml @@ -9,12 +9,7 @@ metadata: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-metrics - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" "metrics") | nindent 4 }} {{- if .Values.controller.metrics.service.labels }} {{- toYaml .Values.controller.metrics.service.labels | nindent 4 }} {{- end }} @@ -26,6 +21,5 @@ spec: port: {{ .Values.controller.metrics.service.servicePort }} targetPort: controller selector: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/charts/argo-cd/templates/argocd-application-controller/prometheusrule.yaml b/charts/argo-cd/templates/argocd-application-controller/prometheusrule.yaml index 8d104f40..485ed1aa 100644 --- a/charts/argo-cd/templates/argocd-application-controller/prometheusrule.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/prometheusrule.yaml @@ -7,12 +7,7 @@ metadata: namespace: {{ .Values.controller.metrics.rules.namespace }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} {{- if .Values.controller.metrics.rules.selector }} {{- toYaml .Values.controller.metrics.rules.selector | nindent 4 }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-application-controller/role.yaml b/charts/argo-cd/templates/argocd-application-controller/role.yaml index 4b0ec4fc..75aec8db 100644 --- a/charts/argo-cd/templates/argocd-application-controller/role.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/role.yaml @@ -3,12 +3,7 @@ kind: Role metadata: name: {{ template "argo-cd.controller.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} rules: - apiGroups: - "" diff --git a/charts/argo-cd/templates/argocd-application-controller/rolebinding.yaml b/charts/argo-cd/templates/argocd-application-controller/rolebinding.yaml index a90ca9f6..f37f4b0c 100644 --- a/charts/argo-cd/templates/argocd-application-controller/rolebinding.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/rolebinding.yaml @@ -3,12 +3,7 @@ kind: RoleBinding metadata: name: {{ template "argo-cd.controller.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/charts/argo-cd/templates/argocd-application-controller/service.yaml b/charts/argo-cd/templates/argocd-application-controller/service.yaml index 69f8ce52..db563135 100644 --- a/charts/argo-cd/templates/argocd-application-controller/service.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/service.yaml @@ -9,17 +9,11 @@ metadata: {{- end }} name: {{ template "argo-cd.controller.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} spec: ports: - name: {{ .Values.controller.service.portName }} port: {{ .Values.controller.service.port }} targetPort: {{ .Values.controller.containerPort }} selector: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} \ No newline at end of file + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 4 }} \ No newline at end of file diff --git a/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml b/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml index fe923c57..4703236c 100644 --- a/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml @@ -11,10 +11,5 @@ metadata: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-application-controller/servicemonitor.yaml b/charts/argo-cd/templates/argocd-application-controller/servicemonitor.yaml index 3fb538e3..51f81030 100644 --- a/charts/argo-cd/templates/argocd-application-controller/servicemonitor.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/servicemonitor.yaml @@ -7,12 +7,7 @@ metadata: namespace: {{ .Values.controller.metrics.serviceMonitor.namespace }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} {{- if .Values.controller.metrics.serviceMonitor.selector }} {{- toYaml .Values.controller.metrics.serviceMonitor.selector | nindent 4 }} {{- end }} @@ -29,7 +24,6 @@ spec: - {{ .Release.Namespace }} selector: matchLabels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-metrics - app.kubernetes.io/component: {{ .Values.controller.name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.controller.name "name" "metrics") | nindent 6 }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml b/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml index ca42e9b9..b17f4f1b 100644 --- a/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml +++ b/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml @@ -4,12 +4,7 @@ kind: ConfigMap metadata: name: argocd-cm labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-cm - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "cm") | nindent 4 }} {{- if .Values.server.configAnnotations }} annotations: {{- range $key, $value := .Values.server.configAnnotations }} diff --git a/charts/argo-cd/templates/argocd-configs/argocd-rbac-cm.yaml b/charts/argo-cd/templates/argocd-configs/argocd-rbac-cm.yaml index 8b7edd55..b02e3a00 100644 --- a/charts/argo-cd/templates/argocd-configs/argocd-rbac-cm.yaml +++ b/charts/argo-cd/templates/argocd-configs/argocd-rbac-cm.yaml @@ -4,12 +4,7 @@ kind: ConfigMap metadata: name: argocd-rbac-cm labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-rbac-cm - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "rbac-cm") | nindent 4 }} {{- if .Values.server.rbacConfigAnnotations }} annotations: {{- range $key, $value := .Values.server.rbacConfigAnnotations }} diff --git a/charts/argo-cd/templates/argocd-configs/argocd-secret.yaml b/charts/argo-cd/templates/argocd-configs/argocd-secret.yaml index efb80358..d84d2649 100644 --- a/charts/argo-cd/templates/argocd-configs/argocd-secret.yaml +++ b/charts/argo-cd/templates/argocd-configs/argocd-secret.yaml @@ -4,12 +4,7 @@ kind: Secret metadata: name: argocd-secret labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-secret - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "secret") | nindent 4 }} {{- if .Values.configs.secret.annotations }} annotations: {{- range $key, $value := .Values.configs.secret.annotations }} diff --git a/charts/argo-cd/templates/argocd-configs/argocd-ssh-known-hosts-cm.yaml b/charts/argo-cd/templates/argocd-configs/argocd-ssh-known-hosts-cm.yaml index 6a8f6dee..289885bd 100644 --- a/charts/argo-cd/templates/argocd-configs/argocd-ssh-known-hosts-cm.yaml +++ b/charts/argo-cd/templates/argocd-configs/argocd-ssh-known-hosts-cm.yaml @@ -3,12 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-ssh-known-hosts-cm - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "ssh-known-hosts-cm") | nindent 4 }} {{- if .Values.configs.knownHostsAnnotations }} annotations: {{- range $key, $value := .Values.configs.knownHostsAnnotations }} diff --git a/charts/argo-cd/templates/argocd-configs/argocd-tls-certs-cm.yaml b/charts/argo-cd/templates/argocd-configs/argocd-tls-certs-cm.yaml index a12ce59e..5b3f5fe5 100644 --- a/charts/argo-cd/templates/argocd-configs/argocd-tls-certs-cm.yaml +++ b/charts/argo-cd/templates/argocd-configs/argocd-tls-certs-cm.yaml @@ -5,12 +5,7 @@ apiVersion: v1 kind: ConfigMap metadata: labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-tls-certs-cm - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "tls-certs-cm") | nindent 4 }} {{- if .Values.configs.tlsCertsAnnotations }} annotations: {{- range $key, $value := .Values.configs.tlsCertsAnnotations }} diff --git a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml index a73dd08f..47f04d9d 100755 --- a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml @@ -4,18 +4,12 @@ kind: Deployment metadata: name: {{ template "argo-cd.repoServer.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.repoServer.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.repoServer.image.tag | quote }} spec: selector: matchLabels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }} - app.kubernetes.io/instance: {{ .Release.Name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.repoServer.name) | nindent 6 }} revisionHistoryLimit: 5 {{- if (ne .Values.repoServer.autoscaling.enabled true) }} replicas: {{ .Values.repoServer.replicas }} @@ -29,12 +23,7 @@ spec: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.repoServer.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 8 }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.repoServer.image.tag | quote }} {{- if .Values.repoServer.podLabels }} {{- toYaml .Values.repoServer.podLabels | nindent 8 }} diff --git a/charts/argo-cd/templates/argocd-repo-server/hpa.yaml b/charts/argo-cd/templates/argocd-repo-server/hpa.yaml index 103c9955..65e379dd 100644 --- a/charts/argo-cd/templates/argocd-repo-server/hpa.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/hpa.yaml @@ -3,12 +3,7 @@ apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }}-hpa - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.repoServer.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" (printf "%s-hpa" .Values.repoServer.name)) | nindent 4 }} name: {{ template "argo-cd.repoServer.fullname" . }}-hpa spec: scaleTargetRef: diff --git a/charts/argo-cd/templates/argocd-repo-server/metrics-service.yaml b/charts/argo-cd/templates/argocd-repo-server/metrics-service.yaml index 99b8eb9e..99061736 100644 --- a/charts/argo-cd/templates/argocd-repo-server/metrics-service.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/metrics-service.yaml @@ -9,12 +9,7 @@ metadata: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ template "argo-cd.repoServer.fullname" . }}-metrics - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.repoServer.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" (printf "%s-metrics" .Values.repoServer.name)) | nindent 4 }} {{- if .Values.repoServer.metrics.service.labels }} {{- toYaml .Values.repoServer.metrics.service.labels | nindent 4 }} {{- end }} @@ -26,6 +21,5 @@ spec: port: {{ .Values.repoServer.metrics.service.servicePort }} targetPort: metrics selector: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.repoServer.name) | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/charts/argo-cd/templates/argocd-repo-server/repository-credentials-secret.yaml b/charts/argo-cd/templates/argocd-repo-server/repository-credentials-secret.yaml index aed7700f..354e2ca9 100644 --- a/charts/argo-cd/templates/argocd-repo-server/repository-credentials-secret.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/repository-credentials-secret.yaml @@ -4,12 +4,7 @@ kind: Secret metadata: name: argocd-repository-credentials labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-secret - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "secret") | nindent 4 }} type: Opaque data: {{- range $key, $value := .Values.configs.repositoryCredentials }} diff --git a/charts/argo-cd/templates/argocd-repo-server/role.yaml b/charts/argo-cd/templates/argocd-repo-server/role.yaml index 9c902ccc..bc422c43 100644 --- a/charts/argo-cd/templates/argocd-repo-server/role.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/role.yaml @@ -4,12 +4,7 @@ kind: Role metadata: name: {{ template "argo-cd.repoServer.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.repoServer.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }} rules: {{- if .Values.repoServer.rbac }} {{toYaml .Values.repoServer.rbac }} diff --git a/charts/argo-cd/templates/argocd-repo-server/rolebinding.yaml b/charts/argo-cd/templates/argocd-repo-server/rolebinding.yaml index 692b11ee..3cfa312f 100644 --- a/charts/argo-cd/templates/argocd-repo-server/rolebinding.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/rolebinding.yaml @@ -4,12 +4,7 @@ kind: RoleBinding metadata: name: {{ template "argo-cd.repoServer.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.repoServer.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/charts/argo-cd/templates/argocd-repo-server/service.yaml b/charts/argo-cd/templates/argocd-repo-server/service.yaml index 169edd31..6ab15747 100644 --- a/charts/argo-cd/templates/argocd-repo-server/service.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/service.yaml @@ -8,12 +8,7 @@ metadata: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.repoServer.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }} name: {{ template "argo-cd.repoServer.fullname" . }} spec: ports: @@ -22,5 +17,4 @@ spec: port: {{ .Values.repoServer.service.port }} targetPort: repo-server selector: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }} \ No newline at end of file + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.repoServer.name) | nindent 4 }} \ No newline at end of file diff --git a/charts/argo-cd/templates/argocd-repo-server/serviceaccount.yaml b/charts/argo-cd/templates/argocd-repo-server/serviceaccount.yaml index ea0c983d..b045da74 100644 --- a/charts/argo-cd/templates/argocd-repo-server/serviceaccount.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/serviceaccount.yaml @@ -11,10 +11,5 @@ metadata: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.repoServer.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/charts/argo-cd/templates/argocd-repo-server/servicemonitor.yaml b/charts/argo-cd/templates/argocd-repo-server/servicemonitor.yaml index c07769f9..0b343750 100644 --- a/charts/argo-cd/templates/argocd-repo-server/servicemonitor.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/servicemonitor.yaml @@ -7,12 +7,7 @@ metadata: namespace: {{ .Values.repoServer.metrics.serviceMonitor.namespace }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.repoServer.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }} {{- if .Values.repoServer.metrics.serviceMonitor.selector }} {{- toYaml .Values.repoServer.metrics.serviceMonitor.selector | nindent 4 }} {{- end }} @@ -29,8 +24,6 @@ spec: - {{ .Release.Namespace }} selector: matchLabels: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/name: {{ template "argo-cd.repoServer.fullname" . }}-metrics - app.kubernetes.io/component: {{ .Values.repoServer.name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.repoServer.name "name" (printf "%s-metrics" .Values.repoServer.name)) | nindent 6 }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-server/backendconfig.yaml b/charts/argo-cd/templates/argocd-server/backendconfig.yaml index 279b3487..16c99c0a 100644 --- a/charts/argo-cd/templates/argocd-server/backendconfig.yaml +++ b/charts/argo-cd/templates/argocd-server/backendconfig.yaml @@ -4,12 +4,7 @@ kind: BackendConfig metadata: name: {{ template "argo-cd.server.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} spec: {{- toYaml .Values.server.GKEbackendConfig.spec | nindent 2 }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-server/certificate.yaml b/charts/argo-cd/templates/argocd-server/certificate.yaml index b2f227b5..7212922c 100644 --- a/charts/argo-cd/templates/argocd-server/certificate.yaml +++ b/charts/argo-cd/templates/argocd-server/certificate.yaml @@ -12,12 +12,7 @@ kind: Certificate metadata: name: {{ template "argo-cd.server.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} spec: commonName: {{ .Values.server.certificate.domain | quote }} dnsNames: diff --git a/charts/argo-cd/templates/argocd-server/clusterrole.yaml b/charts/argo-cd/templates/argocd-server/clusterrole.yaml index 4570454b..63e3ee47 100644 --- a/charts/argo-cd/templates/argocd-server/clusterrole.yaml +++ b/charts/argo-cd/templates/argocd-server/clusterrole.yaml @@ -4,12 +4,7 @@ kind: ClusterRole metadata: name: {{ template "argo-cd.server.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} rules: - apiGroups: - '*' diff --git a/charts/argo-cd/templates/argocd-server/clusterrolebinding.yaml b/charts/argo-cd/templates/argocd-server/clusterrolebinding.yaml index 3bbd5a0d..9f5a960d 100644 --- a/charts/argo-cd/templates/argocd-server/clusterrolebinding.yaml +++ b/charts/argo-cd/templates/argocd-server/clusterrolebinding.yaml @@ -4,12 +4,7 @@ kind: ClusterRoleBinding metadata: name: {{ template "argo-cd.server.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/charts/argo-cd/templates/argocd-server/deployment.yaml b/charts/argo-cd/templates/argocd-server/deployment.yaml index 471949e4..4ae1c4c2 100755 --- a/charts/argo-cd/templates/argocd-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-server/deployment.yaml @@ -4,18 +4,12 @@ kind: Deployment metadata: name: {{ template "argo-cd.server.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.server.image.tag | quote }} spec: selector: matchLabels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - app.kubernetes.io/instance: {{ .Release.Name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 6 }} revisionHistoryLimit: 5 {{- if (ne .Values.server.autoscaling.enabled true) }} replicas: {{ .Values.server.replicas }} @@ -29,12 +23,7 @@ spec: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 8 }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.server.image.tag | quote }} {{- if .Values.server.podLabels }} {{- toYaml .Values.server.podLabels | nindent 8 }} diff --git a/charts/argo-cd/templates/argocd-server/hpa.yaml b/charts/argo-cd/templates/argocd-server/hpa.yaml index be947ef0..e079a7e2 100644 --- a/charts/argo-cd/templates/argocd-server/hpa.yaml +++ b/charts/argo-cd/templates/argocd-server/hpa.yaml @@ -3,12 +3,7 @@ apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }}-hpa - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" (printf "%s-hpa" .Values.server.name)) | nindent 4 }} name: {{ template "argo-cd.server.fullname" . }}-hpa spec: scaleTargetRef: diff --git a/charts/argo-cd/templates/argocd-server/ingress-grpc.yaml b/charts/argo-cd/templates/argocd-server/ingress-grpc.yaml index d2894273..914f1b8a 100644 --- a/charts/argo-cd/templates/argocd-server/ingress-grpc.yaml +++ b/charts/argo-cd/templates/argocd-server/ingress-grpc.yaml @@ -18,12 +18,7 @@ metadata: {{- end }} name: {{ template "argo-cd.server.fullname" . }}-grpc labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} {{- if .Values.server.ingressGrpc.labels }} {{- toYaml .Values.server.ingressGrpc.labels | nindent 4 }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-server/ingress.yaml b/charts/argo-cd/templates/argocd-server/ingress.yaml index 4be764a3..d4e5020f 100644 --- a/charts/argo-cd/templates/argocd-server/ingress.yaml +++ b/charts/argo-cd/templates/argocd-server/ingress.yaml @@ -18,12 +18,7 @@ metadata: {{- end }} name: {{ template "argo-cd.server.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} {{- if .Values.server.ingress.labels }} {{- toYaml .Values.server.ingress.labels | nindent 4 }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-server/metrics-service.yaml b/charts/argo-cd/templates/argocd-server/metrics-service.yaml index 44b8b1e1..3c1f4077 100644 --- a/charts/argo-cd/templates/argocd-server/metrics-service.yaml +++ b/charts/argo-cd/templates/argocd-server/metrics-service.yaml @@ -9,12 +9,7 @@ metadata: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }}-metrics - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" (printf "%s-metrics" .Values.server.name)) | nindent 4 }} {{- if .Values.server.metrics.service.labels }} {{- toYaml .Values.server.metrics.service.labels | nindent 4 }} {{- end }} @@ -26,6 +21,5 @@ spec: port: {{ .Values.server.metrics.service.servicePort }} targetPort: metrics selector: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/charts/argo-cd/templates/argocd-server/role.yaml b/charts/argo-cd/templates/argocd-server/role.yaml index 4b7fe6d8..46eb68d5 100644 --- a/charts/argo-cd/templates/argocd-server/role.yaml +++ b/charts/argo-cd/templates/argocd-server/role.yaml @@ -3,12 +3,7 @@ kind: Role metadata: name: {{ template "argo-cd.server.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} rules: - apiGroups: - "" diff --git a/charts/argo-cd/templates/argocd-server/rolebinding.yaml b/charts/argo-cd/templates/argocd-server/rolebinding.yaml index 37bf10b6..54d4eaeb 100644 --- a/charts/argo-cd/templates/argocd-server/rolebinding.yaml +++ b/charts/argo-cd/templates/argocd-server/rolebinding.yaml @@ -3,12 +3,7 @@ kind: RoleBinding metadata: name: {{ template "argo-cd.server.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/charts/argo-cd/templates/argocd-server/route.yaml b/charts/argo-cd/templates/argocd-server/route.yaml index 7a7f3618..f6b1ce1c 100644 --- a/charts/argo-cd/templates/argocd-server/route.yaml +++ b/charts/argo-cd/templates/argocd-server/route.yaml @@ -4,12 +4,7 @@ kind: Route metadata: name: {{ template "argo-cd.server.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} {{- with .Values.server.route.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/charts/argo-cd/templates/argocd-server/service.yaml b/charts/argo-cd/templates/argocd-server/service.yaml index 489c5b55..72a4018c 100644 --- a/charts/argo-cd/templates/argocd-server/service.yaml +++ b/charts/argo-cd/templates/argocd-server/service.yaml @@ -9,12 +9,7 @@ metadata: {{- end }} name: {{ template "argo-cd.server.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} {{- if .Values.server.service.labels }} {{- toYaml .Values.server.service.labels | nindent 4 }} {{- end }} @@ -36,8 +31,7 @@ spec: nodePort: {{ .Values.server.service.nodePortHttps }} {{- end }} selector: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 4 }} {{- if eq .Values.server.service.type "LoadBalancer" }} {{- if .Values.server.service.loadBalancerIP }} loadBalancerIP: {{ .Values.server.service.loadBalancerIP | quote }} diff --git a/charts/argo-cd/templates/argocd-server/serviceaccount.yaml b/charts/argo-cd/templates/argocd-server/serviceaccount.yaml index c286684c..cd95480b 100644 --- a/charts/argo-cd/templates/argocd-server/serviceaccount.yaml +++ b/charts/argo-cd/templates/argocd-server/serviceaccount.yaml @@ -11,10 +11,5 @@ metadata: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-server/servicemonitor.yaml b/charts/argo-cd/templates/argocd-server/servicemonitor.yaml index b680b4c5..ddf52efa 100644 --- a/charts/argo-cd/templates/argocd-server/servicemonitor.yaml +++ b/charts/argo-cd/templates/argocd-server/servicemonitor.yaml @@ -7,12 +7,7 @@ metadata: namespace: {{ .Values.server.metrics.serviceMonitor.namespace }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} {{- if .Values.server.metrics.serviceMonitor.selector }} {{- toYaml .Values.server.metrics.serviceMonitor.selector | nindent 4 }} {{- end }} @@ -29,8 +24,6 @@ spec: - {{ .Release.Namespace }} selector: matchLabels: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }}-metrics - app.kubernetes.io/component: {{ .Values.server.name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.server.name "name" (printf "%s-metrics" .Values.server.name)) | nindent 6 }} {{- end }} diff --git a/charts/argo-cd/templates/dex/deployment.yaml b/charts/argo-cd/templates/dex/deployment.yaml index c91e38c2..cb40ba54 100755 --- a/charts/argo-cd/templates/dex/deployment.yaml +++ b/charts/argo-cd/templates/dex/deployment.yaml @@ -4,18 +4,12 @@ kind: Deployment metadata: name: {{ template "argo-cd.dex.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.dex.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }} app.kubernetes.io/version: {{ .Values.dex.image.tag | quote }} spec: selector: matchLabels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} - app.kubernetes.io/instance: {{ .Release.Name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.dex.name) | nindent 6 }} template: metadata: {{- if .Values.dex.podAnnotations }} @@ -25,12 +19,7 @@ spec: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.dex.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 8 }} app.kubernetes.io/version: {{ .Values.dex.image.tag | quote }} {{- if .Values.dex.podLabels }} {{- toYaml .Values.dex.podLabels | nindent 8 }} diff --git a/charts/argo-cd/templates/dex/role.yaml b/charts/argo-cd/templates/dex/role.yaml index e2eca1cb..6b9b3f69 100644 --- a/charts/argo-cd/templates/dex/role.yaml +++ b/charts/argo-cd/templates/dex/role.yaml @@ -4,12 +4,7 @@ kind: Role metadata: name: {{ template "argo-cd.dex.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.dex.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }} rules: - apiGroups: - "" diff --git a/charts/argo-cd/templates/dex/rolebinding.yaml b/charts/argo-cd/templates/dex/rolebinding.yaml index 54311e73..4cc47005 100644 --- a/charts/argo-cd/templates/dex/rolebinding.yaml +++ b/charts/argo-cd/templates/dex/rolebinding.yaml @@ -4,12 +4,7 @@ kind: RoleBinding metadata: name: {{ template "argo-cd.dex.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.dex.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/charts/argo-cd/templates/dex/service.yaml b/charts/argo-cd/templates/dex/service.yaml index f10a6d88..6fa77c4e 100644 --- a/charts/argo-cd/templates/dex/service.yaml +++ b/charts/argo-cd/templates/dex/service.yaml @@ -10,12 +10,7 @@ metadata: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.dex.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }} {{- if .Values.dex.metrics.service.labels }} {{- toYaml .Values.dex.metrics.service.labels | nindent 4 }} {{- end }} @@ -36,6 +31,5 @@ spec: targetPort: metrics {{- end }} selector: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} - app.kubernetes.io/instance: {{ .Release.Name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.dex.name) | nindent 4 }} {{- end }} diff --git a/charts/argo-cd/templates/dex/serviceaccount.yaml b/charts/argo-cd/templates/dex/serviceaccount.yaml index 2a12c8fb..bb235eec 100644 --- a/charts/argo-cd/templates/dex/serviceaccount.yaml +++ b/charts/argo-cd/templates/dex/serviceaccount.yaml @@ -11,10 +11,5 @@ metadata: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.dex.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }} {{- end }} diff --git a/charts/argo-cd/templates/dex/servicemonitor.yaml b/charts/argo-cd/templates/dex/servicemonitor.yaml index eb72a573..adc3394a 100644 --- a/charts/argo-cd/templates/dex/servicemonitor.yaml +++ b/charts/argo-cd/templates/dex/servicemonitor.yaml @@ -7,12 +7,7 @@ metadata: namespace: {{ .Values.dex.metrics.serviceMonitor.namespace }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.dex.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }} {{- if .Values.dex.metrics.serviceMonitor.selector }} {{- toYaml .Values.dex.metrics.serviceMonitor.selector | nindent 4 }} {{- end }} @@ -29,7 +24,5 @@ spec: - {{ .Release.Namespace }} selector: matchLabels: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.dex.name }} - app.kubernetes.io/component: {{ .Values.dex.name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 6 }} {{- end }} \ No newline at end of file diff --git a/charts/argo-cd/templates/redis/deployment.yaml b/charts/argo-cd/templates/redis/deployment.yaml index 3ab7ac0c..de88c0d3 100755 --- a/charts/argo-cd/templates/redis/deployment.yaml +++ b/charts/argo-cd/templates/redis/deployment.yaml @@ -5,12 +5,7 @@ kind: Deployment metadata: name: {{ template "argo-cd.redis.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.redis.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }} app.kubernetes.io/version: {{ .Values.redis.image.tag | quote }} spec: selector: @@ -25,12 +20,7 @@ spec: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.redis.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 8 }} app.kubernetes.io/version: {{ .Values.redis.image.tag | quote }} {{- if .Values.redis.podLabels }} {{- toYaml .Values.redis.podLabels | nindent 8 }} diff --git a/charts/argo-cd/templates/redis/service.yaml b/charts/argo-cd/templates/redis/service.yaml index 7916edb2..c7dcae49 100644 --- a/charts/argo-cd/templates/redis/service.yaml +++ b/charts/argo-cd/templates/redis/service.yaml @@ -5,12 +5,7 @@ kind: Service metadata: name: {{ template "argo-cd.redis.fullname" . }} labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.redis.name }} + {{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }} spec: ports: - port: {{ .Values.redis.servicePort }} From eedcf15a9c37e3c308cd5973925a533aacdcaa19 Mon Sep 17 00:00:00 2001 From: Marco Kilchhofer Date: Tue, 23 Mar 2021 13:28:23 +0100 Subject: [PATCH 02/10] fix(argo-cd): One occurrence of label templating was missing (#630) This relates to #627. Signed-off-by: Marco Kilchhofer --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/templates/_helpers.tpl | 2 +- charts/argo-cd/templates/redis/service.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 7cbc9174..38c19b15 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 1.8.4 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 2.17.3 +version: 2.17.4 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index e0810ec7..431f9069 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -133,7 +133,7 @@ Selector labels {{- define "argo-cd.selectorLabels" -}} {{- if .name -}} app.kubernetes.io/name: {{ include "argo-cd.name" .context }}-{{ .name }} -{{- end }} +{{ end -}} app.kubernetes.io/instance: {{ .context.Release.Name }} {{- if .component }} app.kubernetes.io/component: {{ .component }} diff --git a/charts/argo-cd/templates/redis/service.yaml b/charts/argo-cd/templates/redis/service.yaml index c7dcae49..cf1f98bf 100644 --- a/charts/argo-cd/templates/redis/service.yaml +++ b/charts/argo-cd/templates/redis/service.yaml @@ -11,5 +11,5 @@ spec: - port: {{ .Values.redis.servicePort }} targetPort: {{ .Values.redis.servicePort }} selector: - app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }} + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.redis.name) | nindent 4 }} {{- end }} \ No newline at end of file From 976649ec56ff21db2067867a66447df69f97e05d Mon Sep 17 00:00:00 2001 From: Marco Kilchhofer Date: Wed, 31 Mar 2021 14:44:02 +0200 Subject: [PATCH 03/10] fix(argo-cd): only exclude *.tgz in the top-level chart dir (#633) This should fix #585. Ref: - https://github.com/argoproj/argo-helm/issues/585 - https://helm.sh/docs/chart_template_guide/helm_ignore_file/ Signed-off-by: Marco Kilchhofer --- charts/argo-cd/.helmignore | 2 +- charts/argo-cd/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/argo-cd/.helmignore b/charts/argo-cd/.helmignore index 2df6bf53..94c89570 100644 --- a/charts/argo-cd/.helmignore +++ b/charts/argo-cd/.helmignore @@ -1,2 +1,2 @@ -*.tgz +/*.tgz output diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 38c19b15..408fda4f 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 1.8.4 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 2.17.4 +version: 2.17.5 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: From 6adfef338c3f930b87ac5e765f6b4a2bba1e43c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Wed, 31 Mar 2021 16:43:03 +0200 Subject: [PATCH 04/10] fix: oliverbaehler as codeowner (#618) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Oliver Bähler --- CODEOWNERS | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index bc572ce4..f35c9b71 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,16 +1,16 @@ # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners # Argo Workflows -/charts/argo @stefansedich @paguos @vladlosev @yann-soubeyrand +/charts/argo @stefansedich @paguos @vladlosev @yann-soubeyrand @oliverbaehler # Argo CD -/charts/argo-cd @seanson @spencergilbert @davidkarlsen @mr-sour @yann-soubeyrand +/charts/argo-cd @seanson @spencergilbert @davidkarlsen @mr-sour @yann-soubeyrand @oliverbaehler # Argo Events -/charts/argo-events @jbehling @VaibhavPage +/charts/argo-events @jbehling @VaibhavPage @oliverbaehler # Argo Rollouts -/charts/argo-rollouts @cabrinha +/charts/argo-rollouts @cabrinha @oliverbaehler # Argo CD Notifications -/charts/argocd-notifications @alexmt @andyfeller +/charts/argocd-notifications @alexmt @andyfeller @oliverbaehler From 95c1ce0b75d5f3b7c882178188a0f77f3935ffb7 Mon Sep 17 00:00:00 2001 From: kostas-theo <43744618+kostas-theo@users.noreply.github.com> Date: Wed, 31 Mar 2021 19:31:14 +0200 Subject: [PATCH 05/10] fix(argo-events): spec.versions.schema Required for argo-events crds (#605) --- charts/argo-events/Chart.yaml | 2 +- charts/argo-events/crds/eventbus-crd.yml | 22 ++++++++++++++++++ charts/argo-events/crds/eventsource-crd.yml | 23 +++++++++++++++++-- charts/argo-events/crds/sensor-crd.yml | 22 +++++++++++++++++- .../argo-events/templates/eventbus-crd.yaml | 21 +++++++++++++++++ .../templates/eventsource-crd.yaml | 21 +++++++++++++++++ charts/argo-events/templates/sensor-crd.yaml | 21 +++++++++++++++++ 7 files changed, 128 insertions(+), 4 deletions(-) diff --git a/charts/argo-events/Chart.yaml b/charts/argo-events/Chart.yaml index cc676f23..fcea120d 100644 --- a/charts/argo-events/Chart.yaml +++ b/charts/argo-events/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A Helm chart to install Argo-Events in k8s Cluster name: argo-events -version: 1.2.3 +version: 1.2.4 keywords: - argo-events - sensor-controller diff --git a/charts/argo-events/crds/eventbus-crd.yml b/charts/argo-events/crds/eventbus-crd.yml index d7cf3a1c..052984c6 100644 --- a/charts/argo-events/crds/eventbus-crd.yml +++ b/charts/argo-events/crds/eventbus-crd.yml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -16,3 +17,24 @@ spec: - name: v1alpha1 served: true storage: true + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + type: object + x-kubernetes-preserve-unknown-fields: true + status: + type: object + x-kubernetes-preserve-unknown-fields: true + required: + - metadata + - spec + type: object + subresources: + status: {} diff --git a/charts/argo-events/crds/eventsource-crd.yml b/charts/argo-events/crds/eventsource-crd.yml index 3bddfee5..ea49a4aa 100644 --- a/charts/argo-events/crds/eventsource-crd.yml +++ b/charts/argo-events/crds/eventsource-crd.yml @@ -17,5 +17,24 @@ spec: - name: v1alpha1 served: true storage: true - - + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + type: object + x-kubernetes-preserve-unknown-fields: true + status: + type: object + x-kubernetes-preserve-unknown-fields: true + required: + - metadata + - spec + type: object + subresources: + status: {} diff --git a/charts/argo-events/crds/sensor-crd.yml b/charts/argo-events/crds/sensor-crd.yml index 04b1d6b7..d2414bc3 100644 --- a/charts/argo-events/crds/sensor-crd.yml +++ b/charts/argo-events/crds/sensor-crd.yml @@ -17,4 +17,24 @@ spec: - name: v1alpha1 served: true storage: true - + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + type: object + x-kubernetes-preserve-unknown-fields: true + status: + type: object + x-kubernetes-preserve-unknown-fields: true + required: + - metadata + - spec + type: object + subresources: + status: {} diff --git a/charts/argo-events/templates/eventbus-crd.yaml b/charts/argo-events/templates/eventbus-crd.yaml index 673e796f..4a67294e 100644 --- a/charts/argo-events/templates/eventbus-crd.yaml +++ b/charts/argo-events/templates/eventbus-crd.yaml @@ -20,4 +20,25 @@ spec: - name: v1alpha1 served: true storage: true + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + type: object + x-kubernetes-preserve-unknown-fields: true + status: + type: object + x-kubernetes-preserve-unknown-fields: true + required: + - metadata + - spec + type: object + subresources: + status: {} {{- end }} diff --git a/charts/argo-events/templates/eventsource-crd.yaml b/charts/argo-events/templates/eventsource-crd.yaml index 920f2478..5c6a0b6b 100644 --- a/charts/argo-events/templates/eventsource-crd.yaml +++ b/charts/argo-events/templates/eventsource-crd.yaml @@ -20,4 +20,25 @@ spec: - name: v1alpha1 served: true storage: true + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + type: object + x-kubernetes-preserve-unknown-fields: true + status: + type: object + x-kubernetes-preserve-unknown-fields: true + required: + - metadata + - spec + type: object + subresources: + status: {} {{- end }} diff --git a/charts/argo-events/templates/sensor-crd.yaml b/charts/argo-events/templates/sensor-crd.yaml index b9ccc1bd..d121019e 100644 --- a/charts/argo-events/templates/sensor-crd.yaml +++ b/charts/argo-events/templates/sensor-crd.yaml @@ -21,4 +21,25 @@ spec: - name: v1alpha1 served: true storage: true + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + type: object + x-kubernetes-preserve-unknown-fields: true + status: + type: object + x-kubernetes-preserve-unknown-fields: true + required: + - metadata + - spec + type: object + subresources: + status: {} {{- end }} From d27683f40c3122676c1396d8c8c6e84232f04c99 Mon Sep 17 00:00:00 2001 From: MichaelKo Date: Wed, 31 Mar 2021 19:31:59 +0200 Subject: [PATCH 06/10] fix(argo): add extraArgs to controller deployment (#613) Co-authored-by: Alex Collins --- charts/argo/Chart.yaml | 2 +- charts/argo/templates/workflow-controller-deployment.yaml | 3 +++ charts/argo/values.yaml | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/argo/Chart.yaml b/charts/argo/Chart.yaml index d519e34c..1ce323cc 100644 --- a/charts/argo/Chart.yaml +++ b/charts/argo/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v2.12.5 description: A Helm chart for Argo Workflows name: argo -version: 0.16.7 +version: 0.16.8 icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png home: https://github.com/argoproj/argo-helm maintainers: diff --git a/charts/argo/templates/workflow-controller-deployment.yaml b/charts/argo/templates/workflow-controller-deployment.yaml index 82b36bf6..9ad509d0 100755 --- a/charts/argo/templates/workflow-controller-deployment.yaml +++ b/charts/argo/templates/workflow-controller-deployment.yaml @@ -55,6 +55,9 @@ spec: - "--pod-workers" - {{ . | quote }} {{- end }} + {{- if .Values.controller.extraArgs }} + {{- toYaml .Values.controller.extraArgs | nindent 10 }} + {{- end }} env: - name: ARGO_NAMESPACE valueFrom: diff --git a/charts/argo/values.yaml b/charts/argo/values.yaml index 43dc94ae..0a5be36d 100644 --- a/charts/argo/values.yaml +++ b/charts/argo/values.yaml @@ -118,6 +118,8 @@ controller: # The list of environment variable definitions to be added to the controller # manages container verbatim. extraEnv: [] + # Extra arguments to be added to the controller + extraArgs: [] replicas: 1 pdb: enabled: false From 3acd3f76821a9cbfc7eb3764bcb31c7312776438 Mon Sep 17 00:00:00 2001 From: Zichao Qi Date: Wed, 31 Mar 2021 10:32:09 -0700 Subject: [PATCH 07/10] fix(argo): Fix argo-server webhook permission (#628) Co-authored-by: Vlad Losev Co-authored-by: Alex Collins --- charts/argo/templates/server-cluster-roles.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/argo/templates/server-cluster-roles.yaml b/charts/argo/templates/server-cluster-roles.yaml index 85ce605d..b6d47c09 100644 --- a/charts/argo/templates/server-cluster-roles.yaml +++ b/charts/argo/templates/server-cluster-roles.yaml @@ -75,6 +75,8 @@ rules: - events verbs: - watch + - create + - patch {{- if .Values.controller.persistence }} - apiGroups: - "" From ca3d8d376af248aa2a28febe7bab265368f8bade Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Wed, 31 Mar 2021 10:32:57 -0700 Subject: [PATCH 08/10] Create stale.yml --- .github/workflows/stale.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..b671fc09 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,19 @@ +name: Mark stale issues and pull requests + +on: + schedule: + - cron: "30 1 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'Stale issue message' + stale-pr-message: 'Stale pull request message' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' From af0d6b895790b1e3a4d5c0343ecc7fc7552d5d7b Mon Sep 17 00:00:00 2001 From: Marco Kilchhofer Date: Wed, 31 Mar 2021 19:35:48 +0200 Subject: [PATCH 09/10] chore: Update PR template to include notes on DCO (#642) Argo Project has moved from the CLA to the DCO: - https://github.com/argoproj/argoproj/pull/24 - https://github.com/argoproj/argo-cd/pull/4966 Signed-off-by: Marco Kilchhofer --- .github/pull_request_template.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1ed7a9f2..67fe55f4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,9 +1,13 @@ +Note on DCO: + +If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the *Details* link next to the DCO action for instructions on how to resolve this. + Checklist: * [ ] I have updated the chart version in `Chart.yaml` following Semantic Versioning. * [ ] Any new values are backwards compatible and/or have sensible default. * [ ] I have followed the testing instructions in the [contributing guide](https://github.com/argoproj/argo-helm/blob/master/CONTRIBUTING.md). -* [ ] I have signed the CLA and the build is green. -* [ ] I will test my changes again once merged to master and published. +* [ ] I have signed off all my commits as required by [DCO](https://github.com/argoproj/argoproj/tree/master/community#contributing-to-argo). +* [ ] My build is green ([troubleshooting builds](https://argoproj.github.io/argo-cd/developer-guide/ci/)). Changes are automatically published when merged to `master`. They are not published on branches. From 37cd1ef0425ec6d6b7988cc2bf95d8a00758f5c4 Mon Sep 17 00:00:00 2001 From: Matteo Ruina Date: Wed, 31 Mar 2021 19:37:15 +0200 Subject: [PATCH 10/10] Add ApplicationSet chart (#577) Co-authored-by: Alex Collins --- charts/argo-applicationset/.helmignore | 23 + charts/argo-applicationset/Chart.yaml | 14 + charts/argo-applicationset/README.md | 60 + .../crds/crd-applicationset.yaml | 1740 +++++++++++++++++ .../templates/_helpers.tpl | 65 + .../argo-applicationset/templates/crds.yaml | 6 + .../templates/deployment.yaml | 63 + charts/argo-applicationset/templates/psp.yaml | 57 + .../argo-applicationset/templates/rbac.yaml | 89 + .../templates/serviceaccount.yaml | 12 + charts/argo-applicationset/values.yaml | 72 + 11 files changed, 2201 insertions(+) create mode 100644 charts/argo-applicationset/.helmignore create mode 100644 charts/argo-applicationset/Chart.yaml create mode 100644 charts/argo-applicationset/README.md create mode 100644 charts/argo-applicationset/crds/crd-applicationset.yaml create mode 100644 charts/argo-applicationset/templates/_helpers.tpl create mode 100644 charts/argo-applicationset/templates/crds.yaml create mode 100644 charts/argo-applicationset/templates/deployment.yaml create mode 100644 charts/argo-applicationset/templates/psp.yaml create mode 100644 charts/argo-applicationset/templates/rbac.yaml create mode 100644 charts/argo-applicationset/templates/serviceaccount.yaml create mode 100644 charts/argo-applicationset/values.yaml diff --git a/charts/argo-applicationset/.helmignore b/charts/argo-applicationset/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/argo-applicationset/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/argo-applicationset/Chart.yaml b/charts/argo-applicationset/Chart.yaml new file mode 100644 index 00000000..6973c1c1 --- /dev/null +++ b/charts/argo-applicationset/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +name: argocd-applicationset +description: A Helm chart for installing ArgoCD ApplicationSet +type: application +version: 0.1.0 +appVersion: "v0.1.0-prerelease" +home: https://github.com/argoproj/argo-helm +icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png +keywords: + - argoproj + - appset + - gitops +maintainers: + - name: maruina diff --git a/charts/argo-applicationset/README.md b/charts/argo-applicationset/README.md new file mode 100644 index 00000000..5cc51a1a --- /dev/null +++ b/charts/argo-applicationset/README.md @@ -0,0 +1,60 @@ +# Argo CD ApplicationSet Chart + +A Helm chart for Argo CD ApplicationSet, a controller to programmatically generate Argo CD Application. + +Source code can be found [here](https://github.com/argoproj-labs/applicationset/) + +## Additional Information + +This is a **community maintained** chart. This chart installs the [applicationset](https://github.com/argoproj-labs/applicationset) controller. + +This chart currently installs the non-HA version of Argo CD ApplicationSet. + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +$ helm repo add argo https://argoproj.github.io/argo-helm +"argo" has been added to your repositories + +$ helm install --name my-release argo/argo-applicationset +NAME: my-release +... +``` + +### Helm v3 Compatibility + +Users of Helm v3 should set the `installCRDs` value to `false` to avoid warnings about nonexistent webhooks. + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | [Assign custom affinity rules to the deployment](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/) | +| args.metricsAddr | int | `8080` | The default metric address | +| args.probeBindAddr | int | `8081` | The default health check port | +| args.enableLeaderElection | bool | `false` | The default leader election setting | +| args.namespace | string | `argocd` | The default Argo CD repo namespace | +| args.argocdRepoServer | string | `argocd-repo-server:8081` | The default Argo CD repo server address | +| args.policy | string | `sync` | How application is synced between the generator and the cluster | +| args.debug | bool | `false` | Print debug logs | +| args.dryRun | bool | `false` | Enable dry run mode | +| fullnameOverride | string | `""` | Override the default fully qualified app name | +| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| image.repository | string | `"quay.io/argocdapplicationset/argocd-applicationset"` | If defined, a repository applied to the ApplicationSet deployment. | +| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. | +| imagePullSecrets | list | `[]` | If defined, uses a Secret to pull an image from a private Docker registry or repository. | +| installCRDs | bool | `true` | Install Custom Resource Definition | +| nameOverride | string | `""` | Provide a name in place of `argo-applicationset` | +| nodeSelector | object | `{}` | [Node selector](https://kubernetes.io/docs/user-guide/node-selection/) | +| podAnnotations | object | `{}` | Annotations for the controller pods | +| podSecurityContext | object | `{}` | Pod Security Context | +| rbac.pspEnabled | bool | `true` | Enable Pod Security Policy | +| replicaCount | int | `1` | The number of controller pods to run | +| resources | object | `{}` | Resource limits and requests for the controller pods. | +| securityContext | object | `{}` | Security Context | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | +| tolerations | list | `[]` | [Tolerations for use with node taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | diff --git a/charts/argo-applicationset/crds/crd-applicationset.yaml b/charts/argo-applicationset/crds/crd-applicationset.yaml new file mode 100644 index 00000000..734ce34a --- /dev/null +++ b/charts/argo-applicationset/crds/crd-applicationset.yaml @@ -0,0 +1,1740 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.3.0 + name: applicationsets.argoproj.io +spec: + group: argoproj.io + names: + kind: ApplicationSet + listKind: ApplicationSetList + plural: applicationsets + singular: applicationset + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ApplicationSet is a set of Application resources + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ApplicationSetSpec represents a class of application set + state. + properties: + generators: + items: + description: ApplicationSetGenerator include list item info + properties: + clusters: + description: ClusterGenerator defines a generator to match against + clusters registered with ArgoCD. + properties: + selector: + description: Selector defines a label selector to match + against all clusters registered with ArgoCD. Clusters + today are stored as Kubernetes Secrets, thus the Secret + labels will be used for matching the selector. + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, + NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists + or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field + is "key", the operator is "In", and the values array + contains only "value". The requirements are ANDed. + type: object + type: object + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the + Argo CD application fields that may be used for Applications + generated from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application + state. Contains link to repository with application + definition and additional parameters link definition + revision. + properties: + destination: + description: Destination overrides the kubernetes + server and namespace defined in the environment + ksonnet app.yaml + properties: + name: + description: Name of the destination cluster + which can be used instead of server (url) + field + type: string + namespace: + description: Namespace overrides the environment + namespace value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment + server value in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources + fields which should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains + resource filter and list of json paths which + should be ignored during comparison with live + state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information + (URLs, email addresses, and plain text) that relates + to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. + Empty name means that application belongs to 'default' + project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept + in the apps revision history. This should only + be changed in exceptional circumstances. Setting + to zero will store no history. This will reduce + storage used. Increasing will increase the space + used to store the history, so we do not recommend + increasing it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location + ksonnet application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds + jsonnet specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet + External Variables + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search + dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet + Top-level Arguments + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters + to the helm template + items: + description: HelmFileParameter is a file + parameter to a helm template + properties: + name: + description: Name is the name of the + helm parameter + type: string + path: + description: Path is the path value + for the helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to + the helm template + items: + description: HelmParameter is a parameter + to a helm template + properties: + forceString: + description: ForceString determines + whether to tell Helm to interpret + booleans and numbers as strings + type: boolean + name: + description: Name is the name of the + helm parameter + type: string + value: + description: Value is the value for + the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted + it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm + value files to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically + defined as a block + type: string + version: + description: Version is the Helm version + to use for templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific + options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet + component parameter override values + items: + description: KsonnetParameter is a ksonnet + component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific + options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional + kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional + kustomize commonLabels + type: object + images: + description: Images are kustomize image + overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended + to resources for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended + to resources for kustomize apps + type: string + version: + description: Version contains optional Kustomize + version + type: string + type: object + path: + description: Path is a directory path within + the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config + management plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of + the application manifests + type: string + targetRevision: + description: TargetRevision defines the commit, + tag, or branch in which to sync the application + to. If omitted, will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will + be performed + properties: + automated: + description: Automated will keep an application + synced to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have + zero live resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources + automatically as part of automated sync + (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing + if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry + behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount + to back off. Default unit is seconds, + but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply + the base duration after each failed + retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum + amount of time allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum number + of attempts when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole + app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + values: + additionalProperties: + type: string + description: Values contains key/value pairs which are passed + directly as parameters to the template + type: object + type: object + git: + properties: + directories: + items: + properties: + path: + type: string + required: + - path + type: object + type: array + files: + items: + properties: + path: + type: string + required: + - path + type: object + type: array + repoURL: + type: string + requeueAfterSeconds: + format: int64 + type: integer + revision: + type: string + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the + Argo CD application fields that may be used for Applications + generated from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application + state. Contains link to repository with application + definition and additional parameters link definition + revision. + properties: + destination: + description: Destination overrides the kubernetes + server and namespace defined in the environment + ksonnet app.yaml + properties: + name: + description: Name of the destination cluster + which can be used instead of server (url) + field + type: string + namespace: + description: Namespace overrides the environment + namespace value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment + server value in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources + fields which should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains + resource filter and list of json paths which + should be ignored during comparison with live + state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information + (URLs, email addresses, and plain text) that relates + to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. + Empty name means that application belongs to 'default' + project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept + in the apps revision history. This should only + be changed in exceptional circumstances. Setting + to zero will store no history. This will reduce + storage used. Increasing will increase the space + used to store the history, so we do not recommend + increasing it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location + ksonnet application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds + jsonnet specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet + External Variables + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search + dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet + Top-level Arguments + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters + to the helm template + items: + description: HelmFileParameter is a file + parameter to a helm template + properties: + name: + description: Name is the name of the + helm parameter + type: string + path: + description: Path is the path value + for the helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to + the helm template + items: + description: HelmParameter is a parameter + to a helm template + properties: + forceString: + description: ForceString determines + whether to tell Helm to interpret + booleans and numbers as strings + type: boolean + name: + description: Name is the name of the + helm parameter + type: string + value: + description: Value is the value for + the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted + it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm + value files to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically + defined as a block + type: string + version: + description: Version is the Helm version + to use for templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific + options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet + component parameter override values + items: + description: KsonnetParameter is a ksonnet + component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific + options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional + kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional + kustomize commonLabels + type: object + images: + description: Images are kustomize image + overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended + to resources for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended + to resources for kustomize apps + type: string + version: + description: Version contains optional Kustomize + version + type: string + type: object + path: + description: Path is a directory path within + the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config + management plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of + the application manifests + type: string + targetRevision: + description: TargetRevision defines the commit, + tag, or branch in which to sync the application + to. If omitted, will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will + be performed + properties: + automated: + description: Automated will keep an application + synced to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have + zero live resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources + automatically as part of automated sync + (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing + if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry + behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount + to back off. Default unit is seconds, + but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply + the base duration after each failed + retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum + amount of time allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum number + of attempts when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole + app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + required: + - repoURL + - revision + type: object + list: + description: ListGenerator include items info + properties: + elements: + items: + description: ListGeneratorElement include cluster and + url info + properties: + cluster: + type: string + url: + type: string + values: + additionalProperties: + type: string + description: Values contains key/value pairs which + are passed directly as parameters to the template + type: object + required: + - cluster + - url + type: object + type: array + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the + Argo CD application fields that may be used for Applications + generated from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application + state. Contains link to repository with application + definition and additional parameters link definition + revision. + properties: + destination: + description: Destination overrides the kubernetes + server and namespace defined in the environment + ksonnet app.yaml + properties: + name: + description: Name of the destination cluster + which can be used instead of server (url) + field + type: string + namespace: + description: Namespace overrides the environment + namespace value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment + server value in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources + fields which should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains + resource filter and list of json paths which + should be ignored during comparison with live + state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information + (URLs, email addresses, and plain text) that relates + to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. + Empty name means that application belongs to 'default' + project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept + in the apps revision history. This should only + be changed in exceptional circumstances. Setting + to zero will store no history. This will reduce + storage used. Increasing will increase the space + used to store the history, so we do not recommend + increasing it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location + ksonnet application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds + jsonnet specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet + External Variables + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search + dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet + Top-level Arguments + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters + to the helm template + items: + description: HelmFileParameter is a file + parameter to a helm template + properties: + name: + description: Name is the name of the + helm parameter + type: string + path: + description: Path is the path value + for the helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to + the helm template + items: + description: HelmParameter is a parameter + to a helm template + properties: + forceString: + description: ForceString determines + whether to tell Helm to interpret + booleans and numbers as strings + type: boolean + name: + description: Name is the name of the + helm parameter + type: string + value: + description: Value is the value for + the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted + it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm + value files to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically + defined as a block + type: string + version: + description: Version is the Helm version + to use for templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific + options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet + component parameter override values + items: + description: KsonnetParameter is a ksonnet + component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific + options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional + kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional + kustomize commonLabels + type: object + images: + description: Images are kustomize image + overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended + to resources for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended + to resources for kustomize apps + type: string + version: + description: Version contains optional Kustomize + version + type: string + type: object + path: + description: Path is a directory path within + the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config + management plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of + the application manifests + type: string + targetRevision: + description: TargetRevision defines the commit, + tag, or branch in which to sync the application + to. If omitted, will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will + be performed + properties: + automated: + description: Automated will keep an application + synced to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have + zero live resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources + automatically as part of automated sync + (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing + if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry + behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount + to back off. Default unit is seconds, + but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply + the base duration after each failed + retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum + amount of time allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum number + of attempts when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole + app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + required: + - elements + type: object + type: object + type: array + syncPolicy: + description: ApplicationSetSyncPolicy configures how generated Applications + will relate to their ApplicationSet. + properties: + skipPrune: + description: SkipPrune will disable the default behavior which + will delete Applications that are no longer being generated + for the ApplicationSet which created them, or the ApplicationSet + itself is deleted. If SkipPrune is set to true, these Applications + will be orphaned but continue to exist. + type: boolean + type: object + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the Argo CD + application fields that may be used for Applications generated + from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application state. + Contains link to repository with application definition and + additional parameters link definition revision. + properties: + destination: + description: Destination overrides the kubernetes server and + namespace defined in the environment ksonnet app.yaml + properties: + name: + description: Name of the destination cluster which can + be used instead of server (url) field + type: string + namespace: + description: Namespace overrides the environment namespace + value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment server value + in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources fields which + should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains resource + filter and list of json paths which should be ignored + during comparison with live state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information (URLs, + email addresses, and plain text) that relates to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. Empty + name means that application belongs to 'default' project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept in the + apps revision history. This should only be changed in exceptional + circumstances. Setting to zero will store no history. This + will reduce storage used. Increasing will increase the space + used to store the history, so we do not recommend increasing + it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location ksonnet + application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds jsonnet + specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet External + Variables + items: + description: JsonnetVar is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet Top-level + Arguments + items: + description: JsonnetVar is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters to + the helm template + items: + description: HelmFileParameter is a file parameter + to a helm template + properties: + name: + description: Name is the name of the helm parameter + type: string + path: + description: Path is the path value for the + helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to the helm + template + items: + description: HelmParameter is a parameter to a helm + template + properties: + forceString: + description: ForceString determines whether + to tell Helm to interpret booleans and numbers + as strings + type: boolean + name: + description: Name is the name of the helm parameter + type: string + value: + description: Value is the value for the helm + parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted it + will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm value files + to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically defined + as a block + type: string + version: + description: Version is the Helm version to use for + templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet component + parameter override values + items: + description: KsonnetParameter is a ksonnet component + parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional kustomize + commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional kustomize + commonLabels + type: object + images: + description: Images are kustomize image overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended to resources + for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended to resources + for kustomize apps + type: string + version: + description: Version contains optional Kustomize version + type: string + type: object + path: + description: Path is a directory path within the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config management + plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of the application + manifests + type: string + targetRevision: + description: TargetRevision defines the commit, tag, or + branch in which to sync the application to. If omitted, + will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will be performed + properties: + automated: + description: Automated will keep an application synced + to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have zero live + resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources automatically + as part of automated sync (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing if (default: + false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount to back off. + Default unit is seconds, but could also be a + duration (e.g. "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply the + base duration after each failed retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum amount + of time allowed for the backoff strategy + type: string + type: object + limit: + description: Limit is the maximum number of attempts + when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + required: + - generators + - template + type: object + status: + description: ApplicationSetStatus defines the observed state of ApplicationSet + type: object + required: + - metadata + - spec + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/charts/argo-applicationset/templates/_helpers.tpl b/charts/argo-applicationset/templates/_helpers.tpl new file mode 100644 index 00000000..4d0e98b5 --- /dev/null +++ b/charts/argo-applicationset/templates/_helpers.tpl @@ -0,0 +1,65 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "argo-applicationset.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "argo-applicationset.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "argo-applicationset.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "argo-applicationset.labels" -}} +helm.sh/chart: {{ include "argo-applicationset.chart" . }} +{{ include "argo-applicationset.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/name: {{ include "argo-applicationset.name" . }} +app.kubernetes.io/part-of: argo-cd-applicationset +app.kubernetes.io/component: controller +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "argo-applicationset.selectorLabels" -}} +app.kubernetes.io/name: {{ include "argo-applicationset.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "argo-applicationset.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "argo-applicationset.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/argo-applicationset/templates/crds.yaml b/charts/argo-applicationset/templates/crds.yaml new file mode 100644 index 00000000..45ab72d4 --- /dev/null +++ b/charts/argo-applicationset/templates/crds.yaml @@ -0,0 +1,6 @@ +{{- if .Values.installCRDs }} +{{- range $path, $_ := .Files.Glob "crds/*.yaml" }} +{{ $.Files.Get $path }} +--- +{{- end }} +{{- end }} diff --git a/charts/argo-applicationset/templates/deployment.yaml b/charts/argo-applicationset/templates/deployment.yaml new file mode 100644 index 00000000..10ebe70f --- /dev/null +++ b/charts/argo-applicationset/templates/deployment.yaml @@ -0,0 +1,63 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "argo-applicationset.fullname" . }} + labels: + {{- include "argo-applicationset.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "argo-applicationset.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "argo-applicationset.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "argo-applicationset.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + command: + - applicationset-controller + - --metrics-addr={{ .Values.args.metricsAddr }} + - --probe-addr={{ .Values.args.probeBindAddr }} + {{- if or (gt ( .Values.replicaCount | int64) 1) .Values.args.enableLeaderElection }} + - --enable-leader-election=true + {{- end }} + - --namespace={{ .Values.args.namespace }} + - --argocd-repo-server={{ .Values.args.argocdRepoServer }} + - --policy={{ .Values.args.policy }} + - --debug={{ .Values.args.debug }} + - --dry-run={{ .Values.args.dryRun }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ (split ":" .Values.args.probeBindAddr)._1 }} + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/argo-applicationset/templates/psp.yaml b/charts/argo-applicationset/templates/psp.yaml new file mode 100644 index 00000000..dbb75854 --- /dev/null +++ b/charts/argo-applicationset/templates/psp.yaml @@ -0,0 +1,57 @@ +{{- if .Values.rbac.pspEnabled }} +apiVersion: policy/v1beta1 +kind: PodSecurityPolicy +metadata: + name: {{ template "argo-applicationset.fullname" . }} + labels: + {{- include "argo-applicationset.labels" . | nindent 4 }} + annotations: + seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*' +spec: + privileged: false + hostIPC: false + hostNetwork: false + hostPID: false + readOnlyRootFilesystem: false + allowPrivilegeEscalation: false + allowedCapabilities: + - '*' + fsGroup: + rule: RunAsAny + runAsUser: + rule: RunAsAny + seLinux: + rule: RunAsAny + supplementalGroups: + rule: RunAsAny + volumes: + - '*' +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ template "argo-applicationset.fullname" . }}-psp + labels: + {{- include "argo-applicationset.labels" . | nindent 4 }} +rules: + - apiGroups: ['policy'] + resources: ['podsecuritypolicies'] + verbs: ['use'] + resourceNames: + - {{ template "argo-applicationset.fullname" . }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "argo-applicationset.fullname" . }}-psp + labels: + {{- include "argo-applicationset.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "argo-applicationset.fullname" . }}-psp +subjects: + - kind: ServiceAccount + name: {{ template "argo-applicationset.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/charts/argo-applicationset/templates/rbac.yaml b/charts/argo-applicationset/templates/rbac.yaml new file mode 100644 index 00000000..8610a2f3 --- /dev/null +++ b/charts/argo-applicationset/templates/rbac.yaml @@ -0,0 +1,89 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "argo-applicationset.fullname" . }} + labels: + {{- include "argo-applicationset.labels" . | nindent 4 }} +rules: + - apiGroups: + - argoproj.io + resources: + - applications + - applicationsets + - applicationsets/finalizers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - argoproj.io + resources: + - applicationsets/status + verbs: + - get + - patch + - update + - apiGroups: + - '' + resources: + - events + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - '' + resources: + - secrets + verbs: + - get + - list + - watch + - apiGroups: + - '' + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - '' + resources: + - configmaps/status + verbs: + - get + - update + - patch + - apiGroups: + - '' + resources: + - events + verbs: + - create +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "argo-applicationset.fullname" . }} + labels: + {{- include "argo-applicationset.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "argo-applicationset.fullname" . }} +subjects: + - kind: ServiceAccount + name: {{ include "argo-applicationset.serviceAccountName" . }} diff --git a/charts/argo-applicationset/templates/serviceaccount.yaml b/charts/argo-applicationset/templates/serviceaccount.yaml new file mode 100644 index 00000000..1e3c2eaa --- /dev/null +++ b/charts/argo-applicationset/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "argo-applicationset.serviceAccountName" . }} + labels: + {{- include "argo-applicationset.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/argo-applicationset/values.yaml b/charts/argo-applicationset/values.yaml new file mode 100644 index 00000000..9a69f216 --- /dev/null +++ b/charts/argo-applicationset/values.yaml @@ -0,0 +1,72 @@ +# Default values for argo-applicationset. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +installCRDs: true + +image: + # The image repository + repository: quay.io/argocdapplicationset/argocd-applicationset + # Image pull policy + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +args: + metricsAddr: :8080 + probeBindAddr: :8081 + enableLeaderElection: false + namespace: argocd + argocdRepoServer: argocd-repo-server:8081 + policy: sync + debug: false + dryRun: false + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +rbac: + pspEnabled: true + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {}