已有k8s v1.33.6集群,如何安装kubesphere v4.2.1

kubesphere官网:https://docs.kubesphere.com.cn

在线安装 Kubernetes 和 KubeSphere:https://docs.kubesphere.com.cn/v4.2.1/03-installation-and-upgrade/02-install-kubesphere/01-online-install-kubernetes-and-kubesphere/

离线安装 Kubernetes 和 KubeSphere:https://docs.kubesphere.com.cn/v4.2.1/03-installation-and-upgrade/02-install-kubesphere/02-offline-install-kubernetes-and-kubesphere/

 

【系统环境】

操作系统 :ubantu v24.04.4

k8s版本:k8s v1.33.6,

calico版本:calico v1.13.6

集群规划三个节点:

master节点01,主机名:k8s-master-01,ip:172.29.128.1

工作节点01:主机名:k8s-worker-01,ip:172.29.132.68

工作节点02:主机名:k8s-worker-02,ip:172.29.132.69

 

一,【前置准备工作】

1,全节点配置 hosts 解析(规避安装器 hostname 解析报错)

三台机器全部执行:

cat >> /etc/hosts << EOF
172.29.128.1    k8s-master-01
172.29.132.68   k8s-worker-01
172.29.132.69   k8s-worker-02
EOF

 

2,所有点安装依赖(所有worker/master 都安装)

apt update && apt install -y socat conntrack ebtables ipset ipvsadm

 

3,确认 containerd cgroup 驱动(Ubuntu24+k8s1.33 必检)

所有节点执行:
grep SystemdCgroup /etc/containerd/config.toml

输出 SystemdCgroup = false 则修复

sed -i 's/SystemdCgroup \= false/SystemdCgroup \= true/g' /etc/containerd/config.toml
systemctl restart containerd

 

 二,安装helm 

注意: Helm 版本需要 >= 3.17.0。

# 一键执行
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# 验证版本
helm version
# 刷新系统缓存(升级旧helm后必执行)
hash -r

 

如需安装helm 4(全新架构)

# 一键执行
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-4 | bash
# 验证版本
helm version
# 刷新系统缓存(升级旧helm后必执行)
hash -r

 

三,安装kubesphere v4.2.1

chart=oci://hub.kubesphere.com.cn/kse/ks-core
version=1.2.4
helm upgrade --install -n kubesphere-system --create-namespace ks-core $chart \
  --debug --wait --version $version --reset-values --take-ownership \
  --set global.imageRegistry=hub.kubesphere.com.cn,extension.imageRegistry=hub.kubesphere.com.cn \
  --set kseExtensionRepository.image.tag=v11.2.0

 

如果显示如下信息,则表示 KubeSphere 安装成功:

NOTES:
Thank you for choosing KubeSphere Helm Chart.

Please be patient and wait for several seconds for the KubeSphere deployment to complete.

1. Wait for Deployment Completion

    Confirm that all KubeSphere components are running by executing the following command:

    kubectl get pods -n kubesphere-system

2. Access the KubeSphere Console

    Once the deployment is complete, you can access the KubeSphere console using the following URL:

    http://192.168.6.10:30880

3. Login to KubeSphere Console

    Use the following credentials to log in:

    Account: admin
    Password: P@88w0rd

NOTE: It is highly recommended to change the default password immediately after the first login.

 

image

 

集群管理主界面: 

image

  kubesphere v4.x要收费了,没激活只能看,不能修改。

posted @ 2026-07-28 10:58  民工黑猫  阅读(24)  评论(0)    收藏  举报