> 文章列表 > K8S 部署 KubeSphere

K8S 部署 KubeSphere

K8S 部署 KubeSphere

官方文档:https://kubesphere.io/zh/docs/v3.3/quick-start/minimal-kubesphere-on-k8s/

条件

  • Kubernetes 版本必须为:v1.20.x、v1.21.x、* v1.22.x、* v1.23.x 和 * v1.24.x。带星号的版本可能出现边缘节点部分功能不可用的情况。因此,如需使用边缘节点,推荐安装 v1.21.x。
  • 确保您的机器满足最低硬件要求:CPU > 1 核,内存 > 2 GB。
  • 准备好 storageClass 存储卷, 可以参考文章 k8s 安装本地 storageClass 或者 K8S 集群使用 NFS 做 storageclass

 

安装

下载安装文档 kubesphere-installer.yaml 和 cluster-configuration.yaml

https://github.com/kubesphere/ks-installer/releases/download/v3.3.2/kubesphere-installer.yamlhttps://github.com/kubesphere/ks-installer/releases/download/v3.3.2/cluster-configuration.yaml

直接部署会报错,原因是 StorageClass 找不到, StorageClass was not found

K8S 部署 KubeSphere

先删除 deployment

kubectl delete deployment ks-installer -n kubesphere-system

K8S 部署 KubeSphere

修改 cluster-configuration.yaml 中的 storageClass,修改成集群中的 storageClass

apiVersion: installer.kubesphere.io/v1alpha1
kind: ClusterConfiguration
metadata:name: ks-installernamespace: kubesphere-systemlabels:version: v3.3.1
spec:persistence:storageClass: "nfs-client"  

部署命令

kubectl apply -f kubesphere-installer.yamlkubectl apply -f cluster-configuration.yaml

查看日志

kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f

K8S 部署 KubeSphere

部署成功
K8S 部署 KubeSphere
K8S 部署 KubeSphere

自动部署 Node Port,开放 30880 端口
K8S 部署 KubeSphere

默认账号:admin

默认密码:P@88w0rd