系统相关
首页 > 系统相关> > Centos7.7下KubeSphere最小化安装

Centos7.7下KubeSphere最小化安装

作者:互联网

前置环境

安装helm和tiller

前提k8s集群已经搭建好

get_helm.sh

sh get_helm.sh

vi 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
  
kubectl apply -f helm_rbac.yaml

image-20201210202527235

初始化:

helm init --service-account=tiller --tiller-image=sapcc/tiller:v2.16.3 --history-max 300

image-20201210172259509

是否安装成功的验证

kubectl get pods --all-namespaces

image-20201210200121548

如果安装失败,删除重新安装

kubectl get -n kube-system secrets,sa,clusterrolebinding -o name|grep tiller|xargs kubectl -n kube-system delete
kubectl get all -n kube-system -l app=helm -o name|xargs kubectl delete -n kube-system

version:

helm version

image-20201210202809079

如果发现client和service的版本不一致,执行下面命令保证版本相同

helm init --upgrade

image-20201210202910051

确认master是否有污点

kubectl describe node k8s-node1 | grep Taint

image-20201210193404216

去除污点

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

image-20201210193618009

安装OpenEBS

kubectl create ns openebs
helm install --namespace openebs --name openebs stable/openebs --version 1.5.0
kubectl get pods --all-namespaces

image-20201210203745443

等待几分钟,创建完毕

集群已有存储类型(StorageClass),执行 kubectl get sc看下当前是否设置了默认的 storageclass

image-20201210203846630

将openebs-hostpath设置为默认的storageClass

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

修改完成后,我们就可以看到openebs-hostpath被设置为默认storageClass

image-20201210204401127

最小化安装

kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml
kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml
kubectl get pods --all-namespaces
## 等待ks-installer安装完毕

image-20201210220606996

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

等待一段时间(网速慢的话可能要十来分钟),直到出现kubesphere控制台:

image-20201210222026037

访问console,输入出现的account和password,进入首页,至此安装成功。

image-20201210222113865

页面还是蛮炫酷的。

image-20201210222429885

标签:kubectl,name,get,--,KubeSphere,system,helm,最小化,Centos7.7
来源: https://www.cnblogs.com/wwjj4811/p/14117876.html