From 9b7d2857d13c27cf28adff59cc2fee28aa78c5bd Mon Sep 17 00:00:00 2001 From: ChengHao Yang <17496418+tico88612@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:52:54 +0800 Subject: [PATCH] Feat: add kubeadm_config_api_version default variable If kube_version is v1.31 or higher, it will be v1beta4, otherwise it will be v1beta3. Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com> --- roles/kubespray-defaults/defaults/main/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/kubespray-defaults/defaults/main/main.yml b/roles/kubespray-defaults/defaults/main/main.yml index 939027f87..fc978e7d2 100644 --- a/roles/kubespray-defaults/defaults/main/main.yml +++ b/roles/kubespray-defaults/defaults/main/main.yml @@ -26,6 +26,10 @@ kube_version_min_required: v1.29.0 ## Kube Proxy mode One of ['iptables', 'ipvs'] kube_proxy_mode: ipvs +# Kubeadm config api version +# If kube_version is v1.31 or higher, it will be v1beta4, otherwise it will be v1beta3. +kubeadm_config_api_version: "{{ 'v1beta4' if kube_version is version('v1.31.0', '>=') else 'v1beta3' }}" + ## The timeout for init first control-plane kubeadm_init_timeout: 300s