From 35fca24f2e6b950c6ecb8f44c6adc31a8e9dc952 Mon Sep 17 00:00:00 2001 From: shenlan Date: Wed, 25 Jun 2025 21:42:15 +0800 Subject: [PATCH] gpu-k8s: separate kubernetes version --- docs/gpu-k8s-role.md | 6 ++++-- playbooks/roles/vhosts/gpu-k8s/defaults/main.yml | 1 + playbooks/roles/vhosts/gpu-k8s/tasks/install_cluster.yml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/gpu-k8s-role.md b/docs/gpu-k8s-role.md index 293e628..8e8e8f1 100644 --- a/docs/gpu-k8s-role.md +++ b/docs/gpu-k8s-role.md @@ -12,14 +12,16 @@ The role performs four main tasks: 4. **Verify GPU access** by deploying the official NVIDIA device plugin and running a small CUDA workload. When `sealos_version` is set to `latest` (the default), the role automatically -fetches the most recent stable release from GitHub. +fetches the most recent stable release from GitHub. The Kubernetes image tag is +controlled separately via `kubernetes_version`, which defaults to `v1.25.16` but +can be overridden to any compatible release. The following command is used to create the cluster (example with one master and one worker): ```bash sealos run \ - registry.cn-shanghai.aliyuncs.com/labring/kubernetes: \ + registry.cn-shanghai.aliyuncs.com/labring/kubernetes: \ registry.cn-shanghai.aliyuncs.com/labring/cilium: \ registry.cn-shanghai.aliyuncs.com/labring/helm: \ --masters 172.16.11.120 \ diff --git a/playbooks/roles/vhosts/gpu-k8s/defaults/main.yml b/playbooks/roles/vhosts/gpu-k8s/defaults/main.yml index 1a45798..dbd9fc2 100644 --- a/playbooks/roles/vhosts/gpu-k8s/defaults/main.yml +++ b/playbooks/roles/vhosts/gpu-k8s/defaults/main.yml @@ -1,5 +1,6 @@ # Default variables for gpu-k8s role sealos_version: latest +kubernetes_version: v1.25.16 cilium_version: v1.13.4 helm_version: v3.9.4 master_ips: [] # List of up to three master node IPs diff --git a/playbooks/roles/vhosts/gpu-k8s/tasks/install_cluster.yml b/playbooks/roles/vhosts/gpu-k8s/tasks/install_cluster.yml index 1dbb74c..c1d8fa2 100644 --- a/playbooks/roles/vhosts/gpu-k8s/tasks/install_cluster.yml +++ b/playbooks/roles/vhosts/gpu-k8s/tasks/install_cluster.yml @@ -42,7 +42,7 @@ - name: Run sealos to create Kubernetes cluster shell: | sealos run \ - registry.cn-shanghai.aliyuncs.com/labring/kubernetes:{{ sealos_version }} \ + registry.cn-shanghai.aliyuncs.com/labring/kubernetes:{{ kubernetes_version }} \ registry.cn-shanghai.aliyuncs.com/labring/cilium:{{ cilium_version }} \ registry.cn-shanghai.aliyuncs.com/labring/helm:{{ helm_version }} \ --masters {{ master_ips | join(',') }} \