From 767ff29b932bc5165b828bfcfe14489c8c214196 Mon Sep 17 00:00:00 2001 From: Fran Mulero Date: Tue, 28 May 2024 18:44:12 +0200 Subject: [PATCH] [bitnami/parse] Enable PodDisruptionBudgets Signed-off-by: Fran Mulero --- bitnami/parse/Chart.yaml | 2 +- bitnami/parse/README.md | 6 +++++ bitnami/parse/templates/dashboard-pdb.yaml | 30 ++++++++++++++++++++++ bitnami/parse/templates/server-pdb.yaml | 28 ++++++++++++++++++++ bitnami/parse/values.yaml | 20 +++++++++++++++ 5 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 bitnami/parse/templates/dashboard-pdb.yaml create mode 100644 bitnami/parse/templates/server-pdb.yaml diff --git a/bitnami/parse/Chart.yaml b/bitnami/parse/Chart.yaml index 05a78f4ac11cb6..def1b023c50ac5 100644 --- a/bitnami/parse/Chart.yaml +++ b/bitnami/parse/Chart.yaml @@ -38,4 +38,4 @@ maintainers: name: parse sources: - https://github.com/bitnami/charts/tree/main/bitnami/parse -version: 23.1.0 +version: 23.2.0 diff --git a/bitnami/parse/README.md b/bitnami/parse/README.md index f12c76542b085c..bb78636226472e 100644 --- a/bitnami/parse/README.md +++ b/bitnami/parse/README.md @@ -193,6 +193,9 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru | `server.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the Parse container(s) | `[]` | | `server.sidecars` | Add additional sidecar containers to the Parse pod(s) | `[]` | | `server.initContainers` | Add additional init containers to the Parse pod(s) | `[]` | +| `server.pdb.create` | Enable/disable a Pod Disruption Budget creation | `true` | +| `server.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` | +| `server.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `server.pdb.minAvailable` and `server.pdb.maxUnavailable` are empty. | `""` | | `server.enableCloudCode` | Enable Parse Cloud Code | `false` | | `server.cloudCodeScripts` | Cloud Code scripts | `{}` | | `server.existingCloudCodeScriptsCM` | ConfigMap with Cloud Code scripts (Note: Overrides `cloudCodeScripts`). | `""` | @@ -334,6 +337,9 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru | `dashboard.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the Parse container(s) | `[]` | | `dashboard.sidecars` | Add additional sidecar containers to the Parse pod(s) | `[]` | | `dashboard.initContainers` | Add additional init containers to the Parse pod(s) | `[]` | +| `dashboard.pdb.create` | Enable/disable a Pod Disruption Budget creation | `true` | +| `dashboard.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` | +| `dashboard.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `dashboard.pdb.minAvailable` and `dashboard.pdb.maxUnavailable` are empty. | `""` | | `dashboard.forceOverwriteConfFile` | Overwrite config.json configuration file on each run (set to false if mounting a custom configuration file) | `true` | | `dashboard.service.type` | Kubernetes Service type | `LoadBalancer` | | `dashboard.service.ports.http` | Service HTTP port (Dashboard) | `80` | diff --git a/bitnami/parse/templates/dashboard-pdb.yaml b/bitnami/parse/templates/dashboard-pdb.yaml new file mode 100644 index 00000000000000..b6454a8d183c03 --- /dev/null +++ b/bitnami/parse/templates/dashboard-pdb.yaml @@ -0,0 +1,30 @@ +{{- /* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{- if and (include "parse.host" .) .Values.dashboard.enabled .Values.dashboard.pdb.create }} +apiVersion: {{ include "common.capabilities.policy.apiVersion" . }} +kind: PodDisruptionBudget +metadata: + name: {{ include "parse.dashboard.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + {{- $versionLabel := dict "app.kubernetes.io/version" ( include "common.images.version" ( dict "imageRoot" .Values.dashboard.image "chart" .Chart ) ) }} + {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.commonLabels $versionLabel ) "context" . ) }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} + app.kubernetes.io/component: dashboard + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + {{- if .Values.dashboard.pdb.minAvailable }} + minAvailable: {{ .Values.dashboard.pdb.minAvailable }} + {{- end }} + {{- if or .Values.dashboard.pdb.maxUnavailable ( not .Values.dashboard.pdb.minAvailable ) }} + maxUnavailable: {{ .Values.dashboard.pdb.maxUnavailable | default 1 }} + {{- end }} + {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.dashboard.podLabels .Values.commonLabels $versionLabel ) "context" . ) }} + selector: + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} + app.kubernetes.io/component: dashboard +{{- end }} diff --git a/bitnami/parse/templates/server-pdb.yaml b/bitnami/parse/templates/server-pdb.yaml new file mode 100644 index 00000000000000..d21c53d47214b1 --- /dev/null +++ b/bitnami/parse/templates/server-pdb.yaml @@ -0,0 +1,28 @@ +{{- /* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{- if .Values.server.pdb.create }} +apiVersion: {{ include "common.capabilities.policy.apiVersion" . }} +kind: PodDisruptionBudget +metadata: + name: {{ include "parse.server.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + app.kubernetes.io/component: server + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + {{- if .Values.server.pdb.minAvailable }} + minAvailable: {{ .Values.server.pdb.minAvailable }} + {{- end }} + {{- if or .Values.server.pdb.maxUnavailable ( not .Values.server.pdb.minAvailable ) }} + maxUnavailable: {{ .Values.server.pdb.maxUnavailable | default 1 }} + {{- end }} + {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.server.podLabels .Values.commonLabels ) "context" . ) }} + selector: + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} + app.kubernetes.io/component: server +{{- end }} diff --git a/bitnami/parse/values.yaml b/bitnami/parse/values.yaml index 6f0c5ba985ad26..ffc7e1b6d8e852 100644 --- a/bitnami/parse/values.yaml +++ b/bitnami/parse/values.yaml @@ -229,6 +229,16 @@ server: ## command: ['sh', '-c', 'echo "hello world"'] ## initContainers: [] + ## Pod Disruption Budget configuration + ## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb + ## @param server.pdb.create Enable/disable a Pod Disruption Budget creation + ## @param server.pdb.minAvailable Minimum number/percentage of pods that should remain scheduled + ## @param server.pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `server.pdb.minAvailable` and `server.pdb.maxUnavailable` are empty. + ## + pdb: + create: true + minAvailable: "" + maxUnavailable: "" ## @param server.enableCloudCode Enable Parse Cloud Code ## ref: https://github.com/bitnami/containers/tree/main/bitnami/parse#how-to-deploy-your-cloud-functions-with-parse-cloud-code ## @@ -793,6 +803,16 @@ dashboard: ## command: ['sh', '-c', 'echo "hello world"'] ## initContainers: [] + ## Pod Disruption Budget configuration + ## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb + ## @param dashboard.pdb.create Enable/disable a Pod Disruption Budget creation + ## @param dashboard.pdb.minAvailable Minimum number/percentage of pods that should remain scheduled + ## @param dashboard.pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `dashboard.pdb.minAvailable` and `dashboard.pdb.maxUnavailable` are empty. + ## + pdb: + create: true + minAvailable: "" + maxUnavailable: "" ## @param dashboard.forceOverwriteConfFile Overwrite config.json configuration file on each run (set to false if mounting a custom configuration file) ## forceOverwriteConfFile: true