From 9a36897f0e52c4a2119fb69be89e08f395978aa6 Mon Sep 17 00:00:00 2001 From: Vadim Kubasov <66377668+vadim-kubasov@users.noreply.github.com> Date: Tue, 6 Aug 2024 23:03:26 +0400 Subject: [PATCH] Add the ability to customize the priorityClassName (#451) --- .changes/unreleased/ENHANCEMENTS-451-20240806-184914.yaml | 5 +++++ charts/hcp-terraform-operator/README.md | 1 + charts/hcp-terraform-operator/templates/deployment.yaml | 3 +++ charts/hcp-terraform-operator/values.yaml | 3 +++ 4 files changed, 12 insertions(+) create mode 100644 .changes/unreleased/ENHANCEMENTS-451-20240806-184914.yaml diff --git a/.changes/unreleased/ENHANCEMENTS-451-20240806-184914.yaml b/.changes/unreleased/ENHANCEMENTS-451-20240806-184914.yaml new file mode 100644 index 00000000..dd7bdcfe --- /dev/null +++ b/.changes/unreleased/ENHANCEMENTS-451-20240806-184914.yaml @@ -0,0 +1,5 @@ +kind: ENHANCEMENTS +body: '`Helm Chart`: Add the ability to configure the Deployment priority class.' +time: 2024-08-06T18:49:14.110920762+04:00 +custom: + PR: "451" diff --git a/charts/hcp-terraform-operator/README.md b/charts/hcp-terraform-operator/README.md index 6e8a4ca3..22db121c 100644 --- a/charts/hcp-terraform-operator/README.md +++ b/charts/hcp-terraform-operator/README.md @@ -164,6 +164,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. | +| priorityClassName | string | `""` | Deployment priorityClassName. More information in [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/). | | replicaCount | int | `2` | The number of Operator replicas. | | securityContext | object | `{"runAsNonRoot":true}` | Deployment pod security context. More information in [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). | | serviceAccount.annotations | object | `{}` | Additional annotations for the ServiceAccount. | diff --git a/charts/hcp-terraform-operator/templates/deployment.yaml b/charts/hcp-terraform-operator/templates/deployment.yaml index 4f3e0a32..ce05ce9e 100644 --- a/charts/hcp-terraform-operator/templates/deployment.yaml +++ b/charts/hcp-terraform-operator/templates/deployment.yaml @@ -21,6 +21,9 @@ spec: {{- include "hcp-terraform-operator.selectorLabels" . | nindent 8 }} control-plane: {{ .Release.Name }}-controller-manager spec: + {{- with .Values.priorityClassName }} + priorityClassName: {{ . | quote }} + {{- end }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} diff --git a/charts/hcp-terraform-operator/values.yaml b/charts/hcp-terraform-operator/values.yaml index 8cb86e6a..38e9cbe3 100644 --- a/charts/hcp-terraform-operator/values.yaml +++ b/charts/hcp-terraform-operator/values.yaml @@ -11,6 +11,9 @@ replicaCount: 2 securityContext: runAsNonRoot: true +# -- Deployment priorityClassName. More information in [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/). +priorityClassName: "" + # Operator-global options. operator: image: