diff --git a/helm/README.md b/helm/README.md index 95515d27..3a1ae7b0 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 00000000..5b9e1195 --- /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 e062474c..80585b8d 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 ff550abe..587f251c 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: []