CentOS 安装Helm

安装Helm需要kubectl

顺便安装下docker

  • 安装Docker的命令
yum install docker-ce
  • 安装kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod 777 kubectl
# 拷贝到 /usr/local/bin 下
cp kubectl /usr/local/bin
  • 验证kubectl安装
kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.1", GitCommit:"eec55b9ba98609a46fee712359c7b5b365bdd920", GitTreeState:"clean", BuildDate:"2018-12-13T10:39:04Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.1", GitCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", GitTreeState:"clean", BuildDate:"2018-04-12T14:14:26Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
  • 安装helm
wget https://storage.googleapis.com/kubernetes-helm/helm-v2.12.1-linux-amd64.tar.gz
tar -zxvf helm-v2.12.1-linux-amd64.tar.gz
cd linux-amd64/
# 拷贝helm到 /usr/local/bin 
cp helm /usr/local/bin
  • 验证helm
helm version
Client: &version.Version{SemVer:"v2.12.1", GitCommit:"02a47c7249b1fc6d8fd3b94e6b4babf9d818144e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.0", GitCommit:"d325d2a9c179b33af1a024cdb5a4472b6288016a", GitTreeState:"clean"}

如果版本不同的话会有问题
helm get cs
Error: incompatible versions client[v2.10.0] server[v2.9.0]

解决方案:

helm init --upgrade
  • 初始化helm
helm init --client-only
# 可以执行helm push
helm plugin install https://github.com/chartmuseum/helm-push
  • 更新repo
helm repo remove stable
repo remove local
# google 的repo需要翻墙。我们用公司内部的repo,大家可以使用阿里的
helm repo add ali https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
  • 搜索一个chart
helm search nginx
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐