From 4e56132ae57c77d7f09bfd06240bb06a63bfae8a Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:49:18 +0100 Subject: [PATCH 1/3] feat(helm): support labels in values.yaml --- CHANGELOG.md | 2 ++ deploy/helm/druid-operator/templates/_helpers.tpl | 3 +++ deploy/helm/druid-operator/templates/deployment.yaml | 2 +- deploy/helm/druid-operator/templates/roles.yaml | 8 +++++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ca5454e..b5c374ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,12 +7,14 @@ All notable changes to this project will be documented in this file. ### Added - Various documentation of the CRD ([#494]). +- Helm: support labels in values.yaml ([#508]). ### Updated - `operator-rs` `0.56.1` -> `0.57.0` ([#494]). [#494]: https://github.com/stackabletech/druid-operator/pull/494 +[#508]: https://github.com/stackabletech/druid-operator/pull/508 ## [23.11.0] - 2023-11-24 diff --git a/deploy/helm/druid-operator/templates/_helpers.tpl b/deploy/helm/druid-operator/templates/_helpers.tpl index a2258b27..1096ffc6 100644 --- a/deploy/helm/druid-operator/templates/_helpers.tpl +++ b/deploy/helm/druid-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/druid-operator/templates/deployment.yaml b/deploy/helm/druid-operator/templates/deployment.yaml index f60334cd..803f4090 100644 --- a/deploy/helm/druid-operator/templates/deployment.yaml +++ b/deploy/helm/druid-operator/templates/deployment.yaml @@ -23,7 +23,7 @@ spec: labels: {{- include "operator.selectorLabels" . | nindent 8 }} spec: - {{- with .Values.imagePullSecrets }} + {{- with .Values.image.pullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/deploy/helm/druid-operator/templates/roles.yaml b/deploy/helm/druid-operator/templates/roles.yaml index 5206e5b8..e2cdd992 100644 --- a/deploy/helm/druid-operator/templates/roles.yaml +++ b/deploy/helm/druid-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: - "" @@ -135,6 +137,8 @@ apiVersion: security.openshift.io/v1 kind: SecurityContextConstraints metadata: name: druid-scc + labels: + {{- include "operator.labels" . | nindent 4 }} annotations: kubernetes.io/description: |- This resource is derived from hostmount-anyuid. It provides all the features of the @@ -178,6 +182,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ include "operator.name" . }}-clusterrole + labels: + {{- include "operator.labels" . | nindent 4 }} rules: - apiGroups: - "" @@ -202,4 +208,4 @@ rules: - druid-scc verbs: - use -{{ end }} \ No newline at end of file +{{ end }} From fd29cf33a7fb4b61898937416153292a83fb9ef3 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:50:13 +0100 Subject: [PATCH 2/3] fix: changelog typo --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5c374ea..b3ddca8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,14 +7,14 @@ All notable changes to this project will be documented in this file. ### Added - Various documentation of the CRD ([#494]). -- Helm: support labels in values.yaml ([#508]). +- Helm: support labels in values.yaml ([#509]). ### Updated - `operator-rs` `0.56.1` -> `0.57.0` ([#494]). [#494]: https://github.com/stackabletech/druid-operator/pull/494 -[#508]: https://github.com/stackabletech/druid-operator/pull/508 +[#509]: https://github.com/stackabletech/druid-operator/pull/509 ## [23.11.0] - 2023-11-24 From 662fe0f90a9cdc9e0ba814e197913270fd1d8ea9 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 26 Jan 2024 14:04:51 +0100 Subject: [PATCH 3/3] fix: pull policy and labels in values.yaml --- deploy/helm/druid-operator/values.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy/helm/druid-operator/values.yaml b/deploy/helm/druid-operator/values.yaml index 80a224bb..eb82d183 100644 --- a/deploy/helm/druid-operator/values.yaml +++ b/deploy/helm/druid-operator/values.yaml @@ -3,8 +3,8 @@ image: repository: docker.stackable.tech/stackable/druid-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