在 Kubernetes 上部署 KubeSphere

准备工作:

1、Kubernetes版本: 1.15.x ≤ K8s version ≤ 1.17.x
2、Helm版本: 2.10.0 ≤ Helm Version < 3.0.0(不支持 helm 2.16.0 #6894)
3、集群已有默认的StorageClass

如何安装 helm2,上一篇已经说了哈。

部署 openebs

1、让 master 参与调度,去掉污点

kubectl taint nodes master node-role.kubernetes.io/master:NoSchedule-

2、安装 openebs

kubectl apply -f https://openebs.github.io/charts/openebs-operator-1.10.0.yaml

或者使用 Helm
helm install --namespace openebs --name openebs stable/openebs --version 1.10.0

3、将 openebs-hostpath 设置为 默认的 StorageClass

kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
kubectl get sc

部署 KubeSphere

1、为了细化步骤方便排查问题,这里就先最小化安装了
a、下载 yaml 文件

wget https://raw.githubusercontent.com/kubesphere/ks-installer/master/kubesphere-minimal.yaml

b、修改 storageClass,默认是空哈,一开始没注意

persistence:
      storageClass: openebs-hostpath

c、应用 yaml 文件

kubectl apply -f  kubesphere-minimal.yaml

2、查看安装日志

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

3、安装完成后会提示登录信息

#####################################################
###              Welcome to KubeSphere!           ###
#####################################################

Console: http://172.20.47.15:30880
Account: admin
Password: P@88w0rd

4、开启可选功能。修改 ConfigMap

kubectl edit cm -n kubesphere-system ks-installer

组件列表:

  • KubeSphere 多租户日志系统(Logging):日志查询 与 日志收集;
  • KubeSphere 多维度告警通知系统(Alerting & Notification):设置集群节点告警 与 设置工作负载告警;
  • KubeSphere 一站式 DevOps 系统(CI/CD):图形化构建流水线、构建流水线发布项目至 Kubernetes、Source-to-Image;
  • KubeSphere 应用与微服务治理系统(ServiceMesh):微服务的灰度发布与 Tracing、熔断、流量治理;
  • Metrics server:HPA 弹性伸缩;

有的组件是通过 helm 安装的,遇到问题时,如果从 kubernetes 直接看不出线索,可以查看 helm 状态:

内置的 openldap 可以让你用同一个账号登录所有页面,包含 Jenkins、SonarQube 等。

安装完成后效果如下:

颜值很高哈。文档也很全,需要什么可以直接在官网搜索框检索。不过用起来个人感觉不是太友好,哈哈哈...

参考:
https://kubesphere.com.cn/docs/zh-CN/installation/install-on-k8s/
https://github.com/kubesphere/ks-installer
https://github.com/kubesphere/kubesphere/blob/master/README_zh.md
https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/
https://kubesphere.com.cn/forum/d/1471-k8s-kubesphere
https://www.cnblogs.com/ryanyangcs/p/11577767.html

posted @ 2020-06-27 02:03  KeithTt  阅读(1500)  评论(0编辑  收藏  举报