diff --git a/CHANGELOG.md b/CHANGELOG.md index bbbea84..6dbde58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,16 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added + +- Helm: support labels in values.yaml ([#203]). + ### Fixed - Respect `--watch-namespace` CLI argument ([#193]). [#193]: https://github.com/stackabletech/commons-operator/pull/193 +[#203]: https://github.com/stackabletech/commons-operator/pull/203 ## [23.11.0] - 2023-11-24 diff --git a/deploy/helm/commons-operator/templates/_helpers.tpl b/deploy/helm/commons-operator/templates/_helpers.tpl index a2258b2..1096ffc 100644 --- a/deploy/helm/commons-operator/templates/_helpers.tpl +++ b/deploy/helm/commons-operator/templates/_helpers.tpl @@ -55,6 +55,9 @@ Selector labels {{- define "operator.selectorLabels" -}} app.kubernetes.io/name: {{ include "operator.appname" . }} app.kubernetes.io/instance: {{ .Release.Name }} +{{- with .Values.labels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/deploy/helm/commons-operator/templates/deployment.yaml b/deploy/helm/commons-operator/templates/deployment.yaml index f60334c..94fcb3d 100644 --- a/deploy/helm/commons-operator/templates/deployment.yaml +++ b/deploy/helm/commons-operator/templates/deployment.yaml @@ -5,6 +5,8 @@ metadata: name: {{ include "operator.fullname" . }}-deployment labels: {{- include "operator.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- end }} spec: replicas: 1 strategy: @@ -22,8 +24,10 @@ spec: {{- end }} labels: {{- include "operator.selectorLabels" . | nindent 8 }} + {{- with .Values.labels }} + {{- end }} spec: - {{- with .Values.imagePullSecrets }} + {{- with .Values.image.pullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/deploy/helm/commons-operator/templates/roles.yaml b/deploy/helm/commons-operator/templates/roles.yaml index 1c6e87c..db6d05f 100644 --- a/deploy/helm/commons-operator/templates/roles.yaml +++ b/deploy/helm/commons-operator/templates/roles.yaml @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ include "operator.fullname" . }}-clusterrole + labels: + {{- include "operator.labels" . | nindent 4 }} rules: - apiGroups: - "" diff --git a/deploy/helm/commons-operator/values.yaml b/deploy/helm/commons-operator/values.yaml index b674e04..cfeec55 100644 --- a/deploy/helm/commons-operator/values.yaml +++ b/deploy/helm/commons-operator/values.yaml @@ -3,8 +3,8 @@ image: repository: docker.stackable.tech/stackable/commons-operator pullPolicy: IfNotPresent + pullSecrets: [] -imagePullSecrets: [] nameOverride: "" fullnameOverride: "" @@ -19,6 +19,9 @@ serviceAccount: podAnnotations: {} +# Provide additional labels which get attached to all deployed resources +labels: {} + podSecurityContext: {} # fsGroup: 2000