From 06a162e5f5245f50c382fc4e152f749f04401a13 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Mon, 8 Dec 2025 17:02:23 -0500 Subject: [PATCH 1/3] add support for pdb Signed-off-by: drfaust92 --- sftpgo/README.md | 3 +++ sftpgo/values.yaml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/sftpgo/README.md b/sftpgo/README.md index a09fe79..f8c533a 100644 --- a/sftpgo/README.md +++ b/sftpgo/README.md @@ -124,6 +124,9 @@ require at least one port. | initContainers | list | `[]` | Add [init containers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) to the pod. | | nameOverride | string | `""` | A name in place of the chart name for `app:` labels. | | nodeSelector | object | `{}` | [Node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) configuration. | +| pdb.enabled | bool | `false` | Enable Pod Disruption Budget to ensure availability during voluntary disruptions. | +| pdb.maxUnavailable | string | `nil` | Maximum number or percentage of pods that can be unavailable after the eviction. | +| pdb.minAvailable | string | `nil` | Minimum number or percentage of pods that must be available after the eviction. | | persistence.enabled | bool | `false` | Enable persistent storage for the /var/lib/sftpgo directory, saving state of the default sqlite db. | | persistence.pvc | object | `{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"5Gi"}},"storageClassName":""}` | Create the pvc desired specificiation. | | podAnnotations | object | `{}` | Annotations to be added to pods. | diff --git a/sftpgo/values.yaml b/sftpgo/values.yaml index aee1aaf..486d101 100644 --- a/sftpgo/values.yaml +++ b/sftpgo/values.yaml @@ -352,6 +352,14 @@ topologySpreadConstraints: # -- How to deal with a Pod if it doesn't satisfy the spread constraint. whenUnsatisfiable: DoNotSchedule +pdb: + # -- Enable Pod Disruption Budget to ensure availability during voluntary disruptions. + enabled: false + # -- Minimum number or percentage of pods that must be available after the eviction. + minAvailable: + # -- Maximum number or percentage of pods that can be unavailable after the eviction. + maxUnavailable: + persistence: # -- Enable persistent storage for the /var/lib/sftpgo directory, saving state of the default sqlite db. enabled: false From e605a819b16b743b65589c3d91349489f16cf4b4 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Mon, 8 Dec 2025 17:02:28 -0500 Subject: [PATCH 2/3] add support for pdb Signed-off-by: drfaust92 --- sftpgo/templates/pdb.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sftpgo/templates/pdb.yaml diff --git a/sftpgo/templates/pdb.yaml b/sftpgo/templates/pdb.yaml new file mode 100644 index 0000000..caf7cf8 --- /dev/null +++ b/sftpgo/templates/pdb.yaml @@ -0,0 +1,18 @@ +{{- if .Values.pdb.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "sftpgo.fullname" . }} + labels: + {{- include "sftpgo.labels" . | nindent 4 }} +spec: + {{- if .Values.pdb.minAvailable }} + minAvailable: {{ .Values.pdb.minAvailable }} + {{- end }} + {{- if .Values.pdb.maxUnavailable }} + maxUnavailable: {{ .Values.pdb.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "sftpgo.selectorLabels" . | nindent 6 }} +{{- end }} \ No newline at end of file From 3e4de3291c1a2e23b142d475bc82d222517267f9 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Mon, 8 Dec 2025 17:05:47 -0500 Subject: [PATCH 3/3] add support for pdb Signed-off-by: drfaust92 --- sftpgo/README.md | 1 + sftpgo/templates/pod-monitor.yaml | 18 ++++++++++++++++++ sftpgo/values.yaml | 4 ++++ 3 files changed, 23 insertions(+) create mode 100644 sftpgo/templates/pod-monitor.yaml diff --git a/sftpgo/README.md b/sftpgo/README.md index f8c533a..bab51a6 100644 --- a/sftpgo/README.md +++ b/sftpgo/README.md @@ -131,6 +131,7 @@ require at least one port. | persistence.pvc | object | `{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"5Gi"}},"storageClassName":""}` | Create the pvc desired specificiation. | | podAnnotations | object | `{}` | Annotations to be added to pods. | | podLabels | object | `{}` | Labels to be added to pods. | +| podMonitor.enabled | bool | `false` | Enable PodMonitor resource for Prometheus Operator to scrape pod metrics. | | podSecurityContext | object | `{"fsGroup":1000}` | Pod [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) for details. | | replicaCount | int | `1` | Number of replicas (pods) to launch. | | resources | object | No requests or limits. | Container resource [requests and limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#resources) for details. | diff --git a/sftpgo/templates/pod-monitor.yaml b/sftpgo/templates/pod-monitor.yaml new file mode 100644 index 0000000..ec330c5 --- /dev/null +++ b/sftpgo/templates/pod-monitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.podMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ include "sftpgo.fullname" . }} + labels: + {{- include "sftpgo.labels" . | nindent 4 }} +spec: + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + podMetricsEndpoints: + - path: /metrics + port: telemetry + selector: + matchLabels: + {{- include "sftpgo.selectorLabels" . | nindent 6 }} +{{- end }} \ No newline at end of file diff --git a/sftpgo/values.yaml b/sftpgo/values.yaml index 486d101..7d25099 100644 --- a/sftpgo/values.yaml +++ b/sftpgo/values.yaml @@ -372,3 +372,7 @@ persistence: requests: storage: 5Gi storageClassName: "" + +podMonitor: + # -- Enable PodMonitor resource for Prometheus Operator to scrape pod metrics. + enabled: false \ No newline at end of file