This is an automated email from the ASF dual-hosted git repository.
zhangjintao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-helm-chart.git
The following commit(s) were added to refs/heads/master by this push:
new 250d720 feat: PDB updated to Kubernetes 1.25 (#508)
250d720 is described below
commit 250d72052d03a343115c9fe591b6621516f24b3f
Author: Ćukasz Biegaj <[email protected]>
AuthorDate: Thu Jun 29 03:30:15 2023 +0200
feat: PDB updated to Kubernetes 1.25 (#508)
Why:
* Chart could not be installed in Kubernetes 1.25
* The PodDisruptionBudget used apiVersion that is deprecated before and
unavailable in 1.25.
How:
* PodDisruptionBudget apiVersion is updated to match the Kubernetes
version. No spec adjustments needed.
* Changes are applied also to k8s versions in which old api versions were
deprecated.
Reference:
*
https://kubernetes.io/docs/reference/using-api/deprecation-guide/#poddisruptionbudget-v125
I have tested the changes on a 1.25 cluster and reviewed templates visually
for older version.
---
charts/apisix/templates/pdb.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/charts/apisix/templates/pdb.yaml b/charts/apisix/templates/pdb.yaml
index e37239f..60c71bb 100644
--- a/charts/apisix/templates/pdb.yaml
+++ b/charts/apisix/templates/pdb.yaml
@@ -15,7 +15,11 @@
# limitations under the License.
{{- if (and .Values.apisix.enabled .Values.apisix.podDisruptionBudget.enabled)
}}
+{{ if semverCompare "<1.21-0" .Capabilities.KubeVersion.Version -}}
apiVersion: policy/v1beta1
+{{- else -}}
+apiVersion: policy/v1
+{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ include "apisix.fullname" . }}