diff --git a/sftpgo/README.md b/sftpgo/README.md index a09fe79..bab51a6 100644 --- a/sftpgo/README.md +++ b/sftpgo/README.md @@ -124,10 +124,14 @@ 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. | | 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/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 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 aee1aaf..7d25099 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 @@ -364,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