K8S集群部署好了,打算接着部署KubeSphere,

我忽视Helm直接安装KubeSphere不成功,搞不定

只好先装Helm了


安装Helm客户端

#下面是安装最新master版本
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash

#想要指定版本安装的话
curl https://raw.githubusercontent.com/helm/helm/release-2.16/scripts/get | bash

安装回显

Preparing to install helm and tiller into /usr/local/bin
helm installed into /usr/local/bin/helm
tiller installed into /usr/local/bin/tiller
Run 'helm init' to configure helm.

验证一下安装是否成功

helm version
Client: &version.Version{SemVer:"v2.16.9", GitCommit:"145206680c1d5c28e3fcf30d6f596f0ba84fcb47", GitTreeState:"clean"}
Error: could not find tiller

安装的版本为 2.16.9

有个报错,是因为只安装了客户端,还有服务端没装呢

先不用管,把helm 的 bash 命令补全脚本装上再说

helm completion bash > .helmrc && echo "source .helmrc" >> .bashrc
source .helmrc

现在开始装服务端,装服务端之前还要先装一下socat

yum -y install socat

去dockerhub找一个tiller的镜像,版本和Helm一样就可以,2.16.9

pull到本地就行,然后初始化

helm init --service-account tiller --tiller-image=jessestuart/tiller:v2.16.9

这里的镜像名字就是pull到本地的那个

检验tiller是否安装上

kubectl get pod -n kube-system|grep tiller
tiller-deploy-74559f6c8d-5rqjf   1/1     Running   0          61m

查看tiller的repo仓库

[root@master repository]# helm repo list
NAME  	URL                                             
stable	https://kubernetes-charts.storage.googleapis.com
local 	http://127.0.0.1:8879/charts

这一步在work节点中可能会报错

[root@node1 ~]# helm repo list
Error: Couldn't load repositories file (/root/.helm/repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)

不过可以从master节点copy一份/root/.helm/repository/repositories.yaml文件,就OK

tiller删除

可能会发生安装后需要删除或者安装不成功的情况

helm reset -f
rm -rf /root/.helm

然后重新安装即可

下班,明天再次装KubeSphere!
 

 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐