From a13df10428c01523fe74bb2b38517ddb60ff15e7 Mon Sep 17 00:00:00 2001 From: Martin <1403951401@qq.com> Date: Thu, 20 Mar 2025 09:00:37 +0800 Subject: [PATCH] =?UTF-8?q?[*]=20=E6=9B=B4=E6=96=B0=20k8s=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init-k8s.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init-k8s.sh b/init-k8s.sh index 33d417b..36a6601 100644 --- a/init-k8s.sh +++ b/init-k8s.sh @@ -3,7 +3,9 @@ lsb_dist=$(cat /etc/*release | grep ^ID= | cut -d= -f2) # ubuntu or debian? release=$(cat /etc/*release | grep VERSION_CODENAME | cut -d= -f2) # ubuntu(jammy oracular) debian(bookworm).... # 默认值 -K8S_VERSION=${K8S_VERSION:-1.32} # 如果未设置,使用默认值 1.32 +K8S_RELEASE=${K8S_VERSION:-1.32.3} # 如果未设置,使用默认值 1.32.3 +K8S_VERSION=${K8S_RELEASE%.*} + CONTAINERD_VERSION=${CONTAINERD_VERSION:-2.0.2} # 如果未设置,使用默认值 2.0.2 CALICO_VERSION=${CALICO_VERSION:-3.29.1} # 如果未设置,使用默认值 2.0.2 MIRRORS=${MIRRORS:-docker.martin98.com/k8s} # 如果未设置,默认使用集群镜像 @@ -253,7 +255,7 @@ etcd: dataDir: /var/lib/etcd imageRepository: $MIRRORS kind: ClusterConfiguration -kubernetesVersion: "$K8S_VERSION" +kubernetesVersion: "$K8S_RELEASE" networking: dnsDomain: cluster.local podSubnet: $pod_subnet