From 4b0358d20f72f5d6f3dc3ffd3a5f507fd3d127db Mon Sep 17 00:00:00 2001 From: Igor Nikonorov Date: Tue, 9 Mar 2021 20:03:26 +0200 Subject: [PATCH 1/9] feat(argo-cd): add self-heal-timeout as a template variable (#609) Signed-off-by: Igor Nikonorov --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/README.md | 1 + .../templates/argocd-application-controller/deployment.yaml | 2 ++ charts/argo-cd/values.yaml | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index af7da2f2..9bd0a5dc 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.15.0 +version: 2.16.0 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/README.md b/charts/argo-cd/README.md index edfff5f5..382a852a 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -97,6 +97,7 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i | controller.affinity | [Assign custom affinity rules to the deployment](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/) | `{}` | | controller.args.operationProcessors | define the controller `--operation-processors` | `"10"` | | controller.args.appResyncPeriod | define the controller `--app-resync` | `"180"` | +| controller.args.selfHealTimeout | define the controller `--self-heal-timeout-seconds` | `"5"` | | controller.args.statusProcessors | define the controller `--status-processors` | `"20"` | | controller.clusterAdminAccess.enabled | Enable RBAC for local cluster deployments. | `true` | | controller.containerPort | Controller listening port. | `8082` | diff --git a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml index e9a9d700..bf4d9080 100755 --- a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml @@ -57,6 +57,8 @@ spec: - {{ .Values.controller.args.operationProcessors | quote }} - --app-resync - {{ .Values.controller.args.appResyncPeriod | quote }} + - --self-heal-timeout-seconds + - {{ .Values.controller.args.selfHealTimeout | quote }} - --repo-server - {{ template "argo-cd.repoServer.fullname" . }}:{{ .Values.repoServer.service.port }} - --logformat diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index fee16b46..2f67d7ec 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -43,6 +43,7 @@ controller: statusProcessors: "20" operationProcessors: "10" appResyncPeriod: "180" + selfHealTimeout: "5" ## Argo controller log format: text|json logFormat: text From eb16df15daa24b1d61ee95c957d127d0e35ee448 Mon Sep 17 00:00:00 2001 From: Marco Kilchhofer Date: Tue, 9 Mar 2021 21:53:06 +0100 Subject: [PATCH 2/9] fix(argo-cd): Mount emptyDir on repoServer for /tmp and /app/config/gpg/keys (#619) * fix: Mount emptyDir on repoServer when using read-only FS Signed-off-by: Marco Kilchhofer * fix: Mount emptyDir on repoServer for /tmp and /app/config/gpg/keys The emptyDir for /app/config/gpg/keys was already implemented in the plain manifests in the main project: https://github.com/argoproj/argo-cd/pull/4136 Signed-off-by: Marco Kilchhofer --- charts/argo-cd/Chart.yaml | 2 +- .../argo-cd/templates/argocd-repo-server/deployment.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 9bd0a5dc..681d58a3 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.16.0 +version: 2.16.1 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/argocd-repo-server/deployment.yaml b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml index a75c1283..a73dd08f 100755 --- a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml @@ -82,10 +82,8 @@ spec: {{- if .Values.repoServer.volumeMounts }} {{- toYaml .Values.repoServer.volumeMounts | nindent 8}} {{- end }} - {{- if .Values.openshift.enabled }} - mountPath: /app/config/gpg/keys name: gpg-keyring - {{- end }} {{- if .Values.configs.knownHosts }} - mountPath: /app/config/ssh name: ssh-known-hosts @@ -94,6 +92,8 @@ spec: - mountPath: /app/config/tls name: tls-certs {{- end }} + - mountPath: /tmp + name: tmp-dir ports: - name: repo-server containerPort: {{ .Values.repoServer.containerPort }} @@ -142,10 +142,8 @@ spec: {{- if .Values.repoServer.volumes }} {{- toYaml .Values.repoServer.volumes | nindent 6}} {{- end }} - {{- if .Values.openshift.enabled }} - emptyDir: {} name: gpg-keyring - {{- end }} {{- if .Values.configs.knownHosts }} - configMap: name: argocd-ssh-known-hosts-cm @@ -156,6 +154,8 @@ spec: name: argocd-tls-certs-cm name: tls-certs {{- end }} + - emptyDir: {} + name: tmp-dir {{- if .Values.repoServer.initContainers }} initContainers: {{- toYaml .Values.repoServer.initContainers | nindent 6 }} From 650abd1eb1fe26a2af5a21c79d371480ea44bf8c Mon Sep 17 00:00:00 2001 From: Marco Kilchhofer Date: Wed, 10 Mar 2021 11:16:21 +0100 Subject: [PATCH 3/9] feat(argo-cd): prepare (dex) for readOnlyRootFilesystem (#623) --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/templates/dex/deployment.yaml | 16 ++++++++++------ charts/argo-cd/values.yaml | 5 +++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 681d58a3..2ed18117 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.16.1 +version: 2.17.0 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/dex/deployment.yaml b/charts/argo-cd/templates/dex/deployment.yaml index c595a014..c91e38c2 100755 --- a/charts/argo-cd/templates/dex/deployment.yaml +++ b/charts/argo-cd/templates/dex/deployment.yaml @@ -86,10 +86,12 @@ spec: containerPort: {{ .Values.dex.containerPortMetrics }} protocol: TCP {{- end }} -{{- if .Values.dex.volumeMounts }} volumeMounts: -{{- toYaml .Values.dex.volumeMounts | nindent 10 }} -{{- end }} + - mountPath: /tmp + name: tmp-dir + {{- if .Values.dex.volumeMounts }} + {{- toYaml .Values.dex.volumeMounts | nindent 8 }} + {{- end }} resources: {{- toYaml .Values.dex.resources | nindent 10 }} {{- if .Values.dex.nodeSelector }} @@ -105,10 +107,12 @@ spec: {{- toYaml .Values.dex.affinity | nindent 8 }} {{- end }} serviceAccountName: {{ template "argo-cd.dexServiceAccountName" . }} -{{- if .Values.dex.volumes }} volumes: -{{- toYaml .Values.dex.volumes | nindent 8}} -{{- end }} + - emptyDir: {} + name: tmp-dir + {{- if .Values.dex.volumes }} + {{- toYaml .Values.dex.volumes | nindent 6 }} + {{- end }} {{- if .Values.dex.priorityClassName }} priorityClassName: {{ .Values.dex.priorityClassName }} {{- end }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index 2f67d7ec..fd28b21b 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -75,6 +75,7 @@ controller: # capabilities: # drop: # - all + # readOnlyRootFilesystem: true ## Configures the controller port containerPort: 8082 @@ -254,6 +255,7 @@ dex: # capabilities: # drop: # - all + # readOnlyRootFilesystem: true resources: {} # limits: @@ -303,6 +305,7 @@ redis: # capabilities: # drop: # - all + # readOnlyRootFilesystem: true ## Redis Pod specific security context securityContext: @@ -426,6 +429,7 @@ server: # capabilities: # drop: # - all + # readOnlyRootFilesystem: true resources: {} # limits: @@ -786,6 +790,7 @@ repoServer: # capabilities: # drop: # - all + # readOnlyRootFilesystem: true resources: {} # limits: From 04b5c32d802a4e595eac26e06b5797a6b30960b7 Mon Sep 17 00:00:00 2001 From: Joshua Stern <53922259+joshuastern@users.noreply.github.com> Date: Thu, 18 Mar 2021 18:04:52 -0400 Subject: [PATCH 4/9] feat(argo-cd): add the ability to specify automountServiceAccountToken for argo-cd (#626) Signed-off-by: Joshua Stern --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/README.md | 4 ++++ .../argocd-application-controller/serviceaccount.yaml | 1 + .../templates/argocd-repo-server/serviceaccount.yaml | 1 + .../argo-cd/templates/argocd-server/serviceaccount.yaml | 1 + charts/argo-cd/templates/dex/serviceaccount.yaml | 1 + charts/argo-cd/values.yaml | 8 ++++++++ 7 files changed, 17 insertions(+), 1 deletion(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 2ed18117..12c73799 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.0 +version: 2.17.1 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/README.md b/charts/argo-cd/README.md index 382a852a..75a57d67 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -135,6 +135,7 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i | controller.service.labels | Controller service labels. | `{}` | | controller.service.port | Controller service port. | `8082` | | controller.serviceAccount.annotations | Controller service account annotations | `{}` | +| controller.serviceAccount.automountServiceAccountToken | Automount API credentials for the Service Account | `true` | | controller.serviceAccount.create | Create a service account for the controller | `true` | | controller.serviceAccount.name | Service account name. | `"argocd-application-controller"` | | controller.tolerations | [Tolerations for use with node taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | `[]` | @@ -182,6 +183,7 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i | repoServer.replicas | The number of repo server pods to run | `1` | | repoServer.resources | Resource limits and requests for the repo server pods. | `{}` | | repoServer.service.annotations | Repo server service annotations. | `{}` | +| repoServer.service.automountServiceAccountToken | Automount API credentials for the Service Account | `true` | | repoServer.service.labels | Repo server service labels. | `{}` | | repoServer.service.port | Repo server service port. | `8081` | | repoServer.serviceAccount.annotations | Repo server service account annotations | `{}` | @@ -268,6 +270,7 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i | server.service.externalIPs | Server service external IPs. | `[]` | | server.service.type | Server service type | `"ClusterIP"` | | server.serviceAccount.annotations | Server service account annotations | `{}` | +| server.serviceAccount.automountServiceAccountToken | Automount API credentials for the Service Account | `true` | | server.serviceAccount.create | Create server service account | `true` | | server.serviceAccount.name | Server service account name | `"argocd-server"` | | server.tolerations | [Tolerations for use with node taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | `[]` | @@ -300,6 +303,7 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i | dex.podLabels | Labels for the Dex server pods | `{}` | | dex.priorityClassName | Priority class for dex | `""` | | dex.resources | Resource limits and requests for dex | `{}` | +| dex.serviceAccount.automountServiceAccountToken | Automount API credentials for the Service Account | `true` | | dex.serviceAccount.create | Create dex service account | `true` | | dex.serviceAccount.name | Dex service account name | `"argocd-dex-server"` | | dex.servicePortGrpc | Server GRPC port | `5557` | diff --git a/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml b/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml index f93114a6..fe923c57 100644 --- a/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml @@ -1,6 +1,7 @@ {{- if .Values.controller.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount +automountServiceAccountToken: {{ .Values.controller.serviceAccount.automountServiceAccountToken }} metadata: name: {{ template "argo-cd.controllerServiceAccountName" . }} {{- if .Values.controller.serviceAccount.annotations }} diff --git a/charts/argo-cd/templates/argocd-repo-server/serviceaccount.yaml b/charts/argo-cd/templates/argocd-repo-server/serviceaccount.yaml index a0bae942..ea0c983d 100644 --- a/charts/argo-cd/templates/argocd-repo-server/serviceaccount.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/serviceaccount.yaml @@ -1,6 +1,7 @@ {{- if .Values.repoServer.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount +automountServiceAccountToken: {{ .Values.repoServer.serviceAccount.automountServiceAccountToken }} metadata: name: {{ template "argo-cd.repoServerServiceAccountName" . }} {{- if .Values.repoServer.serviceAccount.annotations }} diff --git a/charts/argo-cd/templates/argocd-server/serviceaccount.yaml b/charts/argo-cd/templates/argocd-server/serviceaccount.yaml index 2c02f6b7..c286684c 100644 --- a/charts/argo-cd/templates/argocd-server/serviceaccount.yaml +++ b/charts/argo-cd/templates/argocd-server/serviceaccount.yaml @@ -1,6 +1,7 @@ {{- if .Values.server.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount +automountServiceAccountToken: {{ .Values.server.serviceAccount.automountServiceAccountToken }} metadata: name: {{ template "argo-cd.serverServiceAccountName" . }} {{- if .Values.server.serviceAccount.annotations }} diff --git a/charts/argo-cd/templates/dex/serviceaccount.yaml b/charts/argo-cd/templates/dex/serviceaccount.yaml index 1c9413de..2a12c8fb 100644 --- a/charts/argo-cd/templates/dex/serviceaccount.yaml +++ b/charts/argo-cd/templates/dex/serviceaccount.yaml @@ -1,6 +1,7 @@ {{- if .Values.dex.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount +automountServiceAccountToken: {{ .Values.dex.serviceAccount.automountServiceAccountToken }} metadata: name: {{ template "argo-cd.dexServiceAccountName" . }} {{- if .Values.dex.serviceAccount.annotations }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index fd28b21b..2a6ce24f 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -131,6 +131,8 @@ controller: name: argocd-application-controller ## Annotations applied to created service account annotations: {} + ## Automount API credentials for the Service Account + automountServiceAccountToken: true ## Server metrics controller configuration metrics: @@ -221,6 +223,8 @@ dex: name: argocd-dex-server ## Annotations applied to created service account annotations: {} + ## Automount API credentials for the Service Account + automountServiceAccountToken: true ## Additional volumeMounts to the controller main container. volumeMounts: @@ -482,6 +486,8 @@ server: name: argocd-server ## Annotations applied to created service account annotations: {} + ## Automount API credentials for the Service Account + automountServiceAccountToken: true ingress: enabled: false @@ -828,6 +834,8 @@ repoServer: # name: argocd-repo-server ## Annotations applied to created service account annotations: {} + ## Automount API credentials for the Service Account + automountServiceAccountToken: true ## Repo server rbac rules # rbac: From c6e5412350f554561d336d971e521052a5d1c7fc Mon Sep 17 00:00:00 2001 From: Sergey Shaykhullin <46970457+sergeyshaykhullin@users.noreply.github.com> Date: Fri, 19 Mar 2021 01:38:02 +0300 Subject: [PATCH 5/9] feat(argocd-notifications): Bump argo notifications (#625) Co-authored-by: David J. M. Karlsen --- README.md | 2 +- charts/argocd-notifications/Chart.yaml | 4 ++-- charts/argocd-notifications/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 871c0cab..63c3aa4b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Argo Helm Charts -Argo Helm is a collection of **community maintained** charts for http://argoproj.io/ projects. the charts can be added using following command: +Argo Helm is a collection of **community maintained** charts for http://argoproj.io/ projects. The charts can be added using following command: ``` helm repo add argo https://argoproj.github.io/argo-helm diff --git a/charts/argocd-notifications/Chart.yaml b/charts/argocd-notifications/Chart.yaml index 1aaf9e81..b3853226 100644 --- a/charts/argocd-notifications/Chart.yaml +++ b/charts/argocd-notifications/Chart.yaml @@ -1,9 +1,9 @@ apiVersion: v2 -appVersion: 1.0.1 +appVersion: 1.0.2 description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD. name: argocd-notifications type: application -version: 1.0.14 +version: 1.0.15 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argocd-notifications/values.yaml b/charts/argocd-notifications/values.yaml index 693b377f..ae3fda8f 100644 --- a/charts/argocd-notifications/values.yaml +++ b/charts/argocd-notifications/values.yaml @@ -7,7 +7,7 @@ fullnameOverride: "" image: repository: argoprojlabs/argocd-notifications - tag: v1.0.1 + tag: v1.0.2 pullPolicy: IfNotPresent imagePullSecrets: [] From da2dbda83e9463d902f7e867e2ab2324e9a2dd3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Lemos?= Date: Sat, 20 Mar 2021 15:58:47 +0000 Subject: [PATCH 6/9] fix(argo-cd): crd appproject with invalid schema for jwttokens objects (#620) Signed-off-by: flavio.lemos --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/crds/crd-project.yaml | 37 ++++++++++++++++------------ 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 12c73799..a05fa82b 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.1 +version: 2.17.2 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/crds/crd-project.yaml b/charts/argo-cd/crds/crd-project.yaml index 766b2905..2dab45a5 100644 --- a/charts/argo-cd/crds/crd-project.yaml +++ b/charts/argo-cd/crds/crd-project.yaml @@ -228,23 +228,28 @@ spec: description: Status of the AppProject properties: jwtTokensByRole: - additionalProperties: - description: List of JWTToken objects for a given role - items: - description: Holds the issuedAt and expiresAt values of the token - properties: - exp: - description: The expiresAt value of a token - type: string - iat: - description: The issuedAt value of a token - type: string - id: - description: ID of the token - type: string - type: object - type: array description: JWT Tokens issued for each of the roles in the project + additionalProperties: + properties: + items: + description: List of JWT Tokens issued for the role + items: + description: Holds the issuedAt and expiresAt values of the token + properties: + exp: + description: The expiresAt value of a token + format: int64 + type: integer + iat: + description: The issuedAt value of a token + format: int64 + type: integer + id: + description: ID of the token + type: string + type: object + type: array + type: object type: object type: object required: From 3b0ebdda661d8ff73ce2179fcf4adfdcc09c87bb Mon Sep 17 00:00:00 2001 From: Marco Kilchhofer Date: Mon, 22 Mar 2021 21:15:37 +0100 Subject: [PATCH 7/9] 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 8/9] 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 9/9] 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: