Skip to content

Commit

Permalink
feat(chart): support additional labels (#1339)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Co-authored-by: Kent Rancourt <kent.rancourt@gmail.com>
  • Loading branch information
nlamirault and krancour authored Jan 18, 2024
1 parent 5013409 commit 8b6f58a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 5 deletions.
6 changes: 6 additions & 0 deletions charts/kargo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ the Kargo controller is running.
| `kubeconfigSecrets.argocd` | Kubernetes `Secret` name containing kubeconfig for a remote Kubernetes cluster hosting Argo CD resources. Used by Kargo controller(s) only. | `undefined` |
| `kubeconfigSecrets.rollouts` | Kubernetes `Secret` name containing kubeconfig for a remote Kubernetes cluster that can execute Argo Rollouts AnalysisRuns. Used by Kargo controller(s) only. | `undefined` |

### Labels

| Name | Description | Value |
| ------------------ | ------------------------------------------ | ----- |
| `additionalLabels` | Additional labels to add to all resources. | `{}` |

### API

| Name | Description | Value |
Expand Down
3 changes: 3 additions & 0 deletions charts/kargo/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ helm.sh/chart: {{ include "kargo.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels }}
{{- end }}
{{- end -}}

{{/*
Expand Down
2 changes: 1 addition & 1 deletion charts/kargo/templates/api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
template:
metadata:
labels:
{{- include "kargo.selectorLabels" . | nindent 8 }}
{{- include "kargo.labels" . | nindent 8 }}
{{- include "kargo.api.labels" . | nindent 8 }}
annotations:
configmap/checksum: {{ include (print $.Template.BasePath "/api/configmap.yaml") . | sha256sum }}
Expand Down
2 changes: 1 addition & 1 deletion charts/kargo/templates/controller/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
template:
metadata:
labels:
{{- include "kargo.selectorLabels" . | nindent 8 }}
{{- include "kargo.labels" . | nindent 8 }}
{{- include "kargo.controller.labels" . | nindent 8 }}
annotations:
configmap/checksum: {{ include (print $.Template.BasePath "/controller/configmap.yaml") . | sha256sum }}
Expand Down
2 changes: 1 addition & 1 deletion charts/kargo/templates/dex-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
template:
metadata:
labels:
{{- include "kargo.selectorLabels" . | nindent 8 }}
{{- include "kargo.labels" . | nindent 8 }}
{{- include "kargo.dexServer.labels" . | nindent 8 }}
annotations:
secret/checksum: {{ include (print $.Template.BasePath "/dex-server/secret.yaml") . | sha256sum }}
Expand Down
2 changes: 1 addition & 1 deletion charts/kargo/templates/garbage-collector/cron-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
jobTemplate:
metadata:
labels:
{{- include "kargo.selectorLabels" . | nindent 8 }}
{{- include "kargo.labels" . | nindent 8 }}
{{- include "kargo.garbageCollector.labels" . | nindent 8 }}
annotations:
configmap/checksum: {{ include (print $.Template.BasePath "/garbage-collector/configmap.yaml") . | sha256sum }}
Expand Down
2 changes: 1 addition & 1 deletion charts/kargo/templates/webhooks-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
template:
metadata:
labels:
{{- include "kargo.selectorLabels" . | nindent 8 }}
{{- include "kargo.labels" . | nindent 8 }}
{{- include "kargo.webhooksServer.labels" . | nindent 8 }}
annotations:
configmap/checksum: {{ include (print $.Template.BasePath "/webhooks-server/configmap.yaml") . | sha256sum }}
Expand Down
5 changes: 5 additions & 0 deletions charts/kargo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ kubeconfigSecrets: {}
## @param kubeconfigSecrets.rollouts [nullable] Kubernetes `Secret` name containing kubeconfig for a remote Kubernetes cluster that can execute Argo Rollouts AnalysisRuns. Used by Kargo controller(s) only.
# rollouts: ""

## @section Labels
## @param additionalLabels Additional labels to add to all resources.
additionalLabels: {}
# my-label: my-value

## @section API
api:
## @param api.enabled Whether the API server is enabled.
Expand Down

0 comments on commit 8b6f58a

Please sign in to comment.