From 304f779a2bbccd98471b0e831ce912058ee07025 Mon Sep 17 00:00:00 2001 From: chgl Date: Tue, 23 Nov 2021 00:11:28 +0100 Subject: [PATCH] added options for specifying a PodDisruptionBudget --- charts/hapi-fhir-jpaserver/Chart.yaml | 3 +++ charts/hapi-fhir-jpaserver/README.md | 3 +++ .../templates/poddisruptionbudget.yaml | 19 +++++++++++++++++++ charts/hapi-fhir-jpaserver/values.yaml | 9 +++++++++ 4 files changed, 34 insertions(+) create mode 100644 charts/hapi-fhir-jpaserver/templates/poddisruptionbudget.yaml diff --git a/charts/hapi-fhir-jpaserver/Chart.yaml b/charts/hapi-fhir-jpaserver/Chart.yaml index b4cb3ac..dd2c479 100644 --- a/charts/hapi-fhir-jpaserver/Chart.yaml +++ b/charts/hapi-fhir-jpaserver/Chart.yaml @@ -19,5 +19,8 @@ annotations: - kind: changed description: | updated HAPI FHIR starter image to 5.6.0 + - kind: added + description: | + added support for configuring PodDisruptionBudget for the server pods appVersion: v5.6.0 version: 0.7.0 diff --git a/charts/hapi-fhir-jpaserver/README.md b/charts/hapi-fhir-jpaserver/README.md index efbf65d..9208bd6 100644 --- a/charts/hapi-fhir-jpaserver/README.md +++ b/charts/hapi-fhir-jpaserver/README.md @@ -47,6 +47,9 @@ helm install --render-subchart-notes hapi-fhir-jpaserver hapifhir/hapi-fhir-jpas | networkPolicy.explicitNamespacesSelector | object | `{}` | a Kubernetes LabelSelector to explicitly select namespaces from which ingress traffic could be allowed | | nodeSelector | object | `{}` | node selector for the pod | | podAnnotations | object | `{}` | annotations applied to the server pod | +| podDisruptionBudget.enabled | bool | `false` | Enable PodDisruptionBudget for the server pods. uses policy/v1/PodDisruptionBudget thus requiring k8s 1.21+ | +| podDisruptionBudget.maxUnavailable | string | `""` | maximum unavailable instances | +| podDisruptionBudget.minAvailable | int | `1` | minimum available instances | | podSecurityContext | object | `{}` | pod security context | | postgresql.containerSecurityContext.allowPrivilegeEscalation | bool | `false` | | | postgresql.containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | | diff --git a/charts/hapi-fhir-jpaserver/templates/poddisruptionbudget.yaml b/charts/hapi-fhir-jpaserver/templates/poddisruptionbudget.yaml new file mode 100644 index 0000000..8c35cdd --- /dev/null +++ b/charts/hapi-fhir-jpaserver/templates/poddisruptionbudget.yaml @@ -0,0 +1,19 @@ + +{{- if .Values.podDisruptionBudget.enabled }} +kind: PodDisruptionBudget +apiVersion: policy/v1 +metadata: + name: {{ include "hapi-fhir-jpaserver.fullname" . }} + labels: + {{- include "hapi-fhir-jpaserver.labels" . | nindent 4 }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "hapi-fhir-jpaserver.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/hapi-fhir-jpaserver/values.yaml b/charts/hapi-fhir-jpaserver/values.yaml index 13feab2..5fb71dd 100644 --- a/charts/hapi-fhir-jpaserver/values.yaml +++ b/charts/hapi-fhir-jpaserver/values.yaml @@ -168,3 +168,12 @@ extraEnv: [] # - name: SPRING_FLYWAY_BASELINE_ON_MIGRATE # value: "true" + +podDisruptionBudget: + # -- Enable PodDisruptionBudget for the server pods. + # uses policy/v1/PodDisruptionBudget thus requiring k8s 1.21+ + enabled: false + # -- minimum available instances + minAvailable: 1 + # -- maximum unavailable instances + maxUnavailable: ""