kubesphere 安装与使用(k8s可视化操作)
可以在 linux上安装,也可以 基于K8s 安装。
基于k8s快速部署kubesphere:
1.前提条件,配置默认的存储类
1.1 声明式
kubectl patch storageclass managed-nfs-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
1.2 响应式
[root@master231 storageclasses]# pwd
/manifests/storageclasses
[root@master231 storageclasses]#
[root@master231 storageclasses]# cat class.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: managed-nfs-storage
annotations:
# 让当前的存储类为默认的sc
storageclass.kubernetes.io/is-default-class: "true"
# provisioner: fuseim.pri/ifs # or choose another name, must match deployment's env PROVISIONER_NAME'
provisioner: baimeidashu/linux
parameters:
# 不归档文件,该参数为"reclaimPolicy: Delete"时有效
archiveOnDelete: "false"
# 归档文件,数据不会被真的删除,而是加了一个"archived-*"前缀,该参数为"reclaimPolicy: Delete"时有效
#archiveOnDelete: "true"
# 声明PV回收策略,默认值为Delete
reclaimPolicy: Retain
2.下载资源清单
[root@master231 kubesphere]# wget https://github.com/kubesphere/ks-installer/releases/download/v3.3.2/kubesphere-installer.yaml
[root@master231 kubesphere]# wget https://github.com/kubesphere/ks-installer/releases/download/v3.3.2/cluster-configuration.yaml
3.部署kubesphere服务
部署第一个
kubectl apply -f kubesphere-installer.yaml
上边的需要安装上图的这个镜像, 比较费时间, 可以 先下载后,再导入镜像测试一下。
harbor.baimei.com/tools/ks-installer:v3.3.2
检查一下:
kubectl get pods -o wide --show-labels -n kubesphere-system
部署第2个
kubectl apply -f cluster-configuration.yaml
4.检查安装日志
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
5.查看svc的端口
kubectl get svc/ks-console -n kubesphere-system
6.访问webUI
Console: http://10.0.0.231:30880
Account: admin
Password: P@88w0rd
158a@A
kubectl get sc
登录: