




















一、wegt cluster-configuration.yaml kubesphere-installer.yaml
https://gitcode.com/gh_mirrors/ks/ks-installer/blob/master/deploy/cluster-configuration.yaml
https://gitcode.com/gh_mirrors/ks/ks-installer/blob/master/deploy/kubesphere-installer.yaml
kubesphere-installer.yaml的镜像调整为
#image: kubespheredev/ks-installer:master
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/kubesphere/ks-installer:v3.4.1
注: aityp 搜有效镜像 https://docker.aityp.com/image/docker.io/kubesphere/ks-installer:v3.4.1

二、创建KubeSphere 安装前置校验失败:集群没有配置默认 StorageClass
vi storage.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-nacos
spec:
capacity:
storage: 1Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /data/k8s-pv-nacos
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- k8s-node1---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-nacos
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: local-storage
将该存储类标记为集群默认 StorageClass


验证默认存储类是否创建成功
kubectl get sc

三、
# 清理旧安装控制器
kubectl delete -f kubesphere-installer.yaml
# 重新部署
ks-installer kubectl apply -f kubesphere-installer.yaml
四、查看kubectl logs -f deploy/ks-installer -n kubesphere-system
提示

master 节点之点安装留下的污点
kubectl describe node k8s-master | grep Taints

解决方法
kubesphere-installer.yaml
新增节点添加tolerations配置

spec:
replicas: 1
selector:
matchLabels:
app: ks-installer
template:
metadata:
labels:
app: ks-installer
spec:
tolerations:
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
serviceAccountName: ks-installer重新
kubectl delete -f kubesphere-installer.yaml
kubectl apply -f kubesphere-installer.yaml五、查看kubectl logs -f deploy/ks-installer -n kubesphere-system
提示

kubectl describe pod ks-console-57b987d8b-j61tg -n kubesphere-system
kubectl edit clusterconfiguration ks-installer -n kubesphere-system
找到 spec: 层级,添加一行 zone: cn,示例片段:

保存退出(vi 编辑器按 ESC 输入 :wq 回车)
若保存不了 直接载到本地编辑


#重启 ks-installer,让国内镜像配置生效
kubectl rollout restart deployment ks-installer -n kubesphere-system
六、pod ImagePullBackOff 一般镜像拉不来
kubectl get pods -n kubesphere-system

kubectl describe pod ks-console-768dbcdf9c-n75ns -n kubesphere-system
查看一下pod

kubesphere/ks-console:v3.4.1
docker pull swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/kubesphere/ks-console:v3.4.1
docker tag swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/kubesphere/ks-console:v3.4.1 kubesphere/ks-console:v3.4.1
swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/kubesphere/ks-console:v3.4.1kubesphere/ks-console:v3.4.1
docker rmi swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/kubesphere/ks-console:v3.4.1

原来pod要删除掉,删除完会自动创建
kubectl delete pod ks-console-xxx -n kubesphere-system

也可这样处理
kubectl edit deploy ks-console -n kubesphere-system


七、http://192.168.91.166:30880/dashboard
初始登录账号


此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。