From 4603ece7089267bc940d9cad231424a14137339e Mon Sep 17 00:00:00 2001 From: Juri Malinovski Date: Mon, 29 Dec 2025 03:31:18 +0200 Subject: [PATCH] helm: add enableServiceLinks, poddisruptionbudget (#1293) Signed-off-by: Juri Malinovski --- helm/README.md | 4 ++++ .../rustfs/templates/poddisruptionbudget.yaml | 22 +++++++++++++++++++ helm/rustfs/templates/statefulset.yaml | 1 + helm/rustfs/values.yaml | 10 +++++++++ 4 files changed, 37 insertions(+) create mode 100644 helm/rustfs/templates/poddisruptionbudget.yaml diff --git a/helm/README.md b/helm/README.md index 95515d273..3a1ae7b08 100644 --- a/helm/README.md +++ b/helm/README.md @@ -31,6 +31,7 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | | | containerSecurityContext.readOnlyRootFilesystem | bool | `true` | | | containerSecurityContext.runAsNonRoot | bool | `true` | | +| enableServiceLinks | bool | `false` | | | extraManifests | list | `[]` | List of additional k8s manifests. | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | | @@ -73,6 +74,9 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | mode.standalone.enabled | bool | `false` | RustFS standalone mode support, namely one pod one pvc. | | nameOverride | string | `""` | | | nodeSelector | object | `{}` | | +| pdb.create | bool | `false` | Enable/disable a Pod Disruption Budget creation | +| pdb.maxUnavailable | string | `1` | | +| pdb.minAvailable | string | `""` | | | podAnnotations | object | `{}` | | | podLabels | object | `{}` | | | podSecurityContext.fsGroup | int | `10001` | | diff --git a/helm/rustfs/templates/poddisruptionbudget.yaml b/helm/rustfs/templates/poddisruptionbudget.yaml new file mode 100644 index 000000000..5b9e1195f --- /dev/null +++ b/helm/rustfs/templates/poddisruptionbudget.yaml @@ -0,0 +1,22 @@ +{{- if and .Values.pdb.create .Values.mode.distributed.enabled }} +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "rustfs.fullname" . }} + labels: + {{- include "rustfs.labels" . | nindent 4 }} + {{- with .Values.commonLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.pdb.minAvailable }} + minAvailable: {{ .Values.pdb.minAvailable }} + {{- end }} + {{- if or .Values.pdb.maxUnavailable (not .Values.pdb.minAvailable) }} + maxUnavailable: {{ .Values.pdb.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "rustfs.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/helm/rustfs/templates/statefulset.yaml b/helm/rustfs/templates/statefulset.yaml index e062474c8..80585b8d6 100644 --- a/helm/rustfs/templates/statefulset.yaml +++ b/helm/rustfs/templates/statefulset.yaml @@ -26,6 +26,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} spec: + enableServiceLinks: {{ .Values.enableServiceLinks }} {{- with include "chart.imagePullSecrets" . }} imagePullSecrets: {{- . | nindent 8 }} diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index ff550abe4..587f251ca 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -187,4 +187,14 @@ initStep: runAsUser: 0 runAsGroup: 0 +pdb: + create: false + # Minimum number/percentage of pods that should remain scheduled + minAvailable: "" + # Maximum number/percentage of pods that may be made unavailable + maxUnavailable: 1 + +# Whether information about services should be injected into pod's environment variable +enableServiceLinks: false + extraManifests: []