diff --git a/bitnami/nginx/Chart.yaml b/bitnami/nginx/Chart.yaml index 1bd2fdd9c..5e0ee7485 100644 --- a/bitnami/nginx/Chart.yaml +++ b/bitnami/nginx/Chart.yaml @@ -25,4 +25,4 @@ name: nginx sources: - https://github.com/bitnami/bitnami-docker-nginx - http://www.nginx.org -version: 8.1.2 +version: 8.2.0 diff --git a/bitnami/nginx/README.md b/bitnami/nginx/README.md index 349ed9271..c344f2c88 100644 --- a/bitnami/nginx/README.md +++ b/bitnami/nginx/README.md @@ -66,6 +66,9 @@ The following tables lists the configurable parameters of the NGINX chart and th | `commonLabels` | Labels to add to all deployed objects | `{}` | | `commonAnnotations` | Annotations to add to all deployed objects | `{}` | | `extraDeploy` | Array of extra objects to deploy with the release | `[]` (evaluated as a template) | +| `pdb.create` | Created a PodDisruptionBudget | `false` | +| `pdb.minAvailable` | Set PDB minAvailable value | `1` | +| `pdb.maxUnavailable` | Set PDB maxUnavailable value | `nil` | ### NGINX parameters diff --git a/bitnami/nginx/ci/values-with-ingress-metrics-and-serverblock.yaml b/bitnami/nginx/ci/values-with-ingress-metrics-and-serverblock.yaml index 59562c52a..605d62886 100644 --- a/bitnami/nginx/ci/values-with-ingress-metrics-and-serverblock.yaml +++ b/bitnami/nginx/ci/values-with-ingress-metrics-and-serverblock.yaml @@ -24,3 +24,8 @@ metrics: ## Kubeval doesn't recognise ServiceMonitor as a valid K8s object # serviceMonitor: # enabled: true + +pdb: + create: true + minAvailable: 3 + maxUnavailable: 5 diff --git a/bitnami/nginx/templates/pdb.yaml b/bitnami/nginx/templates/pdb.yaml new file mode 100644 index 000000000..c4f75c2d4 --- /dev/null +++ b/bitnami/nginx/templates/pdb.yaml @@ -0,0 +1,23 @@ +{{- if .Values.pdb.create }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "common.names.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + {{- if .Values.pdb.minAvailable }} + minAvailable: {{ .Values.pdb.minAvailable }} + {{- end }} + {{- if .Values.pdb.maxUnavailable }} + maxUnavailable: {{ .Values.pdb.maxUnavailable }} + {{- end }} + selector: + matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }} +{{- end }} diff --git a/bitnami/nginx/values.schema.json b/bitnami/nginx/values.schema.json index 8b51d9550..d2d5dde76 100644 --- a/bitnami/nginx/values.schema.json +++ b/bitnami/nginx/values.schema.json @@ -76,6 +76,20 @@ } } } + }, + "pdb": { + "type": "object", + "properties": { + "create": { + "type": "boolean" + }, + "minAvailable": { + "type": "integer" + }, + "maxUnavailable": { + "type": "integer" + } + } } } } diff --git a/bitnami/nginx/values.yaml b/bitnami/nginx/values.yaml index 5954186c2..25ba215e2 100644 --- a/bitnami/nginx/values.yaml +++ b/bitnami/nginx/values.yaml @@ -682,3 +682,15 @@ metrics: ## # selector: # prometheus: my-prometheus + +## Pod Disruption Budget configuration +## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ +## +pdb: + create: false + ## Min number of pods that must still be available after the eviction + ## + minAvailable: 1 + ## Max number of pods that can be unavailable after the eviction + ## + # maxUnavailable: 1