From 4b5412fe50472f9e01991056cafcc94721da82df Mon Sep 17 00:00:00 2001 From: Mattias Andersson Date: Thu, 16 May 2024 12:01:46 +0200 Subject: [PATCH] Add possibility to set priorityClassName on InfluxDB Pod via Helmchart https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass --- charts/influxdb/Chart.yaml | 2 +- charts/influxdb/README.md | 1 + charts/influxdb/templates/statefulset.yaml | 3 +++ charts/influxdb/values.yaml | 4 ++++ charts/influxdb2/Chart.yaml | 2 +- charts/influxdb2/templates/statefulset.yaml | 3 +++ charts/influxdb2/values.yaml | 4 ++++ 7 files changed, 17 insertions(+), 2 deletions(-) diff --git a/charts/influxdb/Chart.yaml b/charts/influxdb/Chart.yaml index 6dfabd6b..4e41f149 100755 --- a/charts/influxdb/Chart.yaml +++ b/charts/influxdb/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: influxdb -version: 4.12.5 +version: 4.12.6 appVersion: 1.8.10 description: Scalable datastore for metrics, events, and real-time analytics. keywords: diff --git a/charts/influxdb/README.md b/charts/influxdb/README.md index 918b1701..765ab2c7 100644 --- a/charts/influxdb/README.md +++ b/charts/influxdb/README.md @@ -71,6 +71,7 @@ The following table lists configurable parameters, their descriptions, and their | persistence.size | Storage size | 8Gi | | podAnnotations | Annotations for pod | {} | | podLabels | Labels for pod | {} | +| priorityClassName | PriorityClass configuration for InfluxDB Pods | "" | | ingress.enabled | Boolean flag to enable or disable ingress | false | | ingress.tls | Boolean to enable or disable tls for ingress. If enabled provide a secret in `ingress.secretName` containing TLS private key and certificate. | false | | ingress.secretName | Kubernetes secret containing TLS private key and certificate. It is `only` required if `ingress.tls` is enabled. | nil | diff --git a/charts/influxdb/templates/statefulset.yaml b/charts/influxdb/templates/statefulset.yaml index f2b21c00..46cb9bef 100644 --- a/charts/influxdb/templates/statefulset.yaml +++ b/charts/influxdb/templates/statefulset.yaml @@ -44,6 +44,9 @@ spec: {{- if .Values.securityContext }} securityContext: {{ toYaml .Values.securityContext | indent 8 }} + {{- end }} + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName }} {{- end }} {{- if .Values.image.pullSecrets }} imagePullSecrets: diff --git a/charts/influxdb/values.yaml b/charts/influxdb/values.yaml index 73d35976..5e5430e7 100644 --- a/charts/influxdb/values.yaml +++ b/charts/influxdb/values.yaml @@ -136,6 +136,10 @@ podAnnotations: {} # Labels to be added to InfluxDB pods podLabels: {} +## Configure priorityClass for InfluxDB Statefulset +## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass +priorityClassName: "" + ingress: enabled: false tls: false diff --git a/charts/influxdb2/Chart.yaml b/charts/influxdb2/Chart.yaml index 018f72f6..ae32455e 100644 --- a/charts/influxdb2/Chart.yaml +++ b/charts/influxdb2/Chart.yaml @@ -4,7 +4,7 @@ name: influxdb2 description: A Helm chart for InfluxDB v2 home: https://www.influxdata.com/products/influxdb/ type: application -version: 2.1.2 +version: 2.1.3 maintainers: - name: rawkode email: rawkode@influxdata.com diff --git a/charts/influxdb2/templates/statefulset.yaml b/charts/influxdb2/templates/statefulset.yaml index a18d7a20..fd416bbb 100644 --- a/charts/influxdb2/templates/statefulset.yaml +++ b/charts/influxdb2/templates/statefulset.yaml @@ -158,6 +158,9 @@ spec: securityContext: fsGroup: {{ .Values.securityContext.runAsGroup }} {{- end }} + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | nindent 8 | trim }} diff --git a/charts/influxdb2/values.yaml b/charts/influxdb2/values.yaml index c870ec73..96dec21a 100644 --- a/charts/influxdb2/values.yaml +++ b/charts/influxdb2/values.yaml @@ -90,6 +90,10 @@ startupProbe: # key: my-key env: {} +## Configure priorityClass for InfluxDB Statefulset +## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass +priorityClassName: "" + ## Create default user through docker entrypoint ## Defaults indicated below ##