KuberSphere安装

1 安装helm

#创建目录
mkdir /usr/local/bin
#执行脚本
curl -L https://git.io/get_helm.sh | bash

2 配置权限

#权限
kubectl apply -f helm-rbac.yaml
#初始化
helm init --service-account=tiller --tiller-image=sapcc/tiller:v2.16.3   --history-max 300

#helm-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: tiller
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
  - kind: ServiceAccount
    name: tiller
    namespace: kube-system

3 安装 OpenEBS 创建 LocalPV 存储类型

kubectl get node -o wide
#去除污点
kubectl describe node master | grep Taint
#去除master的污点
kubectl taint nodes master node-role.kubernetes.io/master:NoSchedule-

#安装OpenEBS
kubectl create ns openebs
helm install --namespace openebs --name openebs stable/openebs --version 1.5.0
#验证
kubectl get sc
#如下将 openebs-hostpath设置为 默认的 StorageClass
kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
#验证
kubectl get sc

在这里插入图片描述

4 最小化安装 KubeSphere

kubectl apply -f https://raw.githubusercontent.com/kubesphere/ks-installer/master/kubesphere-complete-setup.yaml
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

KuberSphere安装_第1张图片
KuberSphere安装_第2张图片

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

KuberSphere安装_第3张图片

5 安装devops

5.1 关闭虚拟机更改配置

master 4G  4核
node1 11G  6核
node2 11G  6核

KuberSphere安装_第4张图片

5.2 安装组件

#官网地址
https://kubesphere.io/docs/zh-CN/installation/install-metrics-server/
#开启devops、
kubectl edit cm -n kubesphere-system ks-installer

KuberSphere安装_第5张图片

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

KuberSphere安装_第6张图片
KuberSphere安装_第7张图片

你可能感兴趣的:(Kubernetes,KuberSphere安装)