Helm是什么?
Helm可以管理Kubernetes应用程序-Helm Charts帮助您定义,安装和升级最复杂的Kubernetes应用程序。
下载Helm 在https://github.com/helm/helm/releases
最新发布版本是这个,使用wget下载
wget https://get.helm.sh/helm-v2.16.0-linux-amd64.tar.gz
下的太慢了,我就直接用本机下载过来Xftp传上去了。
然后执行:
tar -zxvf helm-v2.16.0-linux-amd64.tar.gz mv linux-amd64/helm /usr/local/bin/helm
基于角色的访问控制(RABC) :rabc-tiller.yml
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 rabc-tiller.yml
查看helm版本信息:
helm version Client: &version.Version{SemVer:"v2.16.0", GitCommit:"e13bc94621d4ef666270cfbe734aaabf342a49bb", GitTreeState:"clean"} Error: could not find tiller
安装helm, tiller使用阿里云源(Server/Client版本要一致):
helm init --service-account tiller --tiller-image registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.16.0 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
Creating /root/.helm Creating /root/.helm/repository Creating /root/.helm/repository/cache Creating /root/.helm/repository/local Creating /root/.helm/plugins Creating /root/.helm/starters Creating /root/.helm/cache/archive Creating /root/.helm/repository/repositories.yaml Adding stable repo with URL: https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts Adding local repo with URL: http://127.0.0.1:8879/charts $HELM_HOME has been configured at /root/.helm. Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster. Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy. To prevent this, run `helm init` with the --tiller-tls-verify flag. For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
再查看版本信息:
helm version Client: &version.Version{SemVer:"v2.16.0", GitCommit:"e13bc94621d4ef666270cfbe734aaabf342a49bb", GitTreeState:"clean"} Server: &version.Version{SemVer:"v2.16.0", GitCommit:"e13bc94621d4ef666270cfbe734aaabf342a49bb", GitTreeState:"clean"}
就安装成功了
如果出现错误可使用以下命令:
helm reset : 重置 rm -rf /root/.helm : 删除helm配置 kubernetes删除helm和tiller相关配置: kubectl delete deployment tiller-deploy -n kube-system kubectl delete service tiller-deploy -n kube-system 如果pod删除不掉,可强制删除: kubectl delete pod <pod name> --namespace=<pod namespace> --grace-period=0 --force