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 9dbadff5..3f796fb5 100644 --- a/charts/hcp-terraform-operator/README.md +++ b/charts/hcp-terraform-operator/README.md @@ -182,6 +182,7 @@ For a more detailed explanation, please refer to the [FAQ](../../docs/faq.md#gen | operator.tfeAddress | string | `""` | The API URL of a Terraform Enterprise instance. | | operator.tolerations | list | `[]` | Kubernetes Tolerations. More information: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ | | 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. | diff --git a/charts/hcp-terraform-operator/templates/deployment.yaml b/charts/hcp-terraform-operator/templates/deployment.yaml index 1ee3d431..a1def5a6 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 b8ff0784..b3bdafd8 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