From 37e302c10b722fea8b855d9136622bdc38aebf7b Mon Sep 17 00:00:00 2001 From: Martin Lefler Date: Thu, 21 Nov 2024 15:29:05 +0100 Subject: [PATCH 1/2] add podLabels option to add custom labels to operator pods --- charts/hcp-terraform-operator/templates/deployment.yaml | 3 +++ charts/hcp-terraform-operator/values.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/charts/hcp-terraform-operator/templates/deployment.yaml b/charts/hcp-terraform-operator/templates/deployment.yaml index 5d68fbbe..d95cf7fd 100644 --- a/charts/hcp-terraform-operator/templates/deployment.yaml +++ b/charts/hcp-terraform-operator/templates/deployment.yaml @@ -20,6 +20,9 @@ spec: labels: {{- include "hcp-terraform-operator.selectorLabels" . | nindent 8 }} control-plane: {{ .Release.Name }}-controller-manager + {{- with .Values.podLabels }} + {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} spec: {{- with .Values.priorityClassName }} priorityClassName: {{ . | quote }} diff --git a/charts/hcp-terraform-operator/values.yaml b/charts/hcp-terraform-operator/values.yaml index 9166dc14..d5984903 100644 --- a/charts/hcp-terraform-operator/values.yaml +++ b/charts/hcp-terraform-operator/values.yaml @@ -4,6 +4,9 @@ # -- Reference to one or more secrets essential for pulling container images. imagePullSecrets: [] +# -- Additional labels to add to the Operator pods. +podLabels: {} + # -- The number of Operator replicas. replicaCount: 2 From ac6640b9d65f1dc6ea0e8a70412f6e8ce4171821 Mon Sep 17 00:00:00 2001 From: Martin Lefler Date: Sun, 1 Dec 2024 18:57:34 +0100 Subject: [PATCH 2/2] update docs & changelog --- .changes/unreleased/ENHANCEMENTS-522-20241201-185649.yaml | 5 +++++ charts/hcp-terraform-operator/README.md | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changes/unreleased/ENHANCEMENTS-522-20241201-185649.yaml diff --git a/.changes/unreleased/ENHANCEMENTS-522-20241201-185649.yaml b/.changes/unreleased/ENHANCEMENTS-522-20241201-185649.yaml new file mode 100644 index 00000000..cf523b1b --- /dev/null +++ b/.changes/unreleased/ENHANCEMENTS-522-20241201-185649.yaml @@ -0,0 +1,5 @@ +kind: ENHANCEMENTS +body: '`Helm Chart`: Add the ability to configure additional labels for the Operator pod.' +time: 2024-12-01T18:56:49.558093+01:00 +custom: + PR: "522" diff --git a/charts/hcp-terraform-operator/README.md b/charts/hcp-terraform-operator/README.md index 42c1ea3a..ea69ac0a 100644 --- a/charts/hcp-terraform-operator/README.md +++ b/charts/hcp-terraform-operator/README.md @@ -180,6 +180,7 @@ For a more detailed explanation, please refer to the [FAQ](../../docs/faq.md#gen | operator.syncPeriod | string | `"5m"` | The minimum frequency at which watched resources are reconciled. Format: `5s`, `1m`, etc. | | operator.tfeAddress | string | `""` | The API URL of a Terraform Enterprise instance. | | operator.watchedNamespaces | list | `[]` | List of namespaces the controllers should watch. | +| podLabels | object | `{}` | Additional labels to add to the Operator pods. | | priorityClassName | string | `""` | Deployment priorityClassName. More information in [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/). | | rbac.create | bool | `true` | Specifies whether a Role-Based Access Control (RBAC) resources should be created | | replicaCount | int | `2` | The number of Operator replicas. |