You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by ab...@apache.org on 2023/02/15 05:54:08 UTC

[druid] branch master updated: helm: Fix PDB apiVersion to allow K8s 1.25+ deployment (#13783)

This is an automated email from the ASF dual-hosted git repository.

abhishek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 355cdbeb86 helm: Fix PDB apiVersion to allow K8s 1.25+ deployment (#13783)
355cdbeb86 is described below

commit 355cdbeb86faf71d30066c036f75652c3e926b69
Author: Jason Witkowski <jw...@gmail.com>
AuthorDate: Wed Feb 15 00:54:01 2023 -0500

    helm: Fix PDB apiVersion to allow K8s 1.25+ deployment (#13783)
---
 helm/druid/Chart.yaml                       |  2 +-
 helm/druid/templates/_capabilities.tpl      | 17 +++++++++++++++++
 helm/druid/templates/historical/pdb.yaml    |  2 +-
 helm/druid/templates/middleManager/pdb.yaml |  2 +-
 4 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/helm/druid/Chart.yaml b/helm/druid/Chart.yaml
index 8bbc003de3..cc4083be29 100644
--- a/helm/druid/Chart.yaml
+++ b/helm/druid/Chart.yaml
@@ -30,7 +30,7 @@ dependencies:
     version: 8.6.4
     repository: https://charts.helm.sh/stable
     condition: postgresql.enabled
-version: 0.3.3
+version: 0.3.4
 home: https://druid.apache.org/
 icon: https://druid.apache.org/img/favicon.png
 sources:
diff --git a/helm/druid/templates/_capabilities.tpl b/helm/druid/templates/_capabilities.tpl
new file mode 100644
index 0000000000..f0a0c86155
--- /dev/null
+++ b/helm/druid/templates/_capabilities.tpl
@@ -0,0 +1,17 @@
+{{/*
+Return the target Kubernetes version
+*/}}
+{{- define "capabilities.kubeVersion" -}}
+{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for poddisruptionbudget.
+*/}}
+{{- define "capabilities.policy.apiVersion" -}}
+{{- if semverCompare "<1.21-0" (include "capabilities.kubeVersion" .) -}}
+{{- print "policy/v1beta1" -}}
+{{- else -}}
+{{- print "policy/v1" -}}
+{{- end -}}
+{{- end -}}
diff --git a/helm/druid/templates/historical/pdb.yaml b/helm/druid/templates/historical/pdb.yaml
index 13b000034c..c921b1909d 100644
--- a/helm/druid/templates/historical/pdb.yaml
+++ b/helm/druid/templates/historical/pdb.yaml
@@ -18,7 +18,7 @@
 */}}
 
 {{- if .Values.historical.podDisruptionBudget.enabled }}
-apiVersion: policy/v1beta1
+apiVersion: {{ include "capabilities.policy.apiVersion" . }}
 kind: PodDisruptionBudget
 metadata:
   labels:
diff --git a/helm/druid/templates/middleManager/pdb.yaml b/helm/druid/templates/middleManager/pdb.yaml
index 5e3bccf1aa..71a592979a 100644
--- a/helm/druid/templates/middleManager/pdb.yaml
+++ b/helm/druid/templates/middleManager/pdb.yaml
@@ -18,7 +18,7 @@
 */}}
 
 {{- if .Values.middleManager.podDisruptionBudget.enabled }}
-apiVersion: policy/v1beta1
+apiVersion: {{ include "capabilities.policy.apiVersion" . }}
 kind: PodDisruptionBudget
 metadata:
   labels:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org