在官网下载指定想要版本的helm并传入服务器:https://github.com/helm/helm/releases
tar zxvf helm-xxxxx-linux-amd64.tar.gz
mv liniux-amd64/helm /usr/local/bin
helm version #查看helm client版本
创建rbac-config.yaml,并输入以下内容:
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
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 create -f rbac-config.yaml
以上步骤配置成功后,安装tiller。(和helm client对应的版本一样)
# google源
helm init --service-account tiller --upgrade -i gcr.io/kubernetes-helm/tiller:v2.11.0
# 阿里源
helm init --service-account tiller --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.11.0 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
参数--stable-repo-url
用于拉取charts所在源的位置,如果不设置则默认访问官方charts
查看tiller是否安装成功
[root@k8s-master01 helm]# kubectl get pod -n kube-system -l app=helm
NAME READY STATUS RESTARTS AGE
tiller-deploy-66cdf6dfc8-p7x7g 1/1 Running 0 20d
添加其他charts可使用helm repo add <name> <url>
常用命令:
helm list --all #列出所有部署应用
helm repo list #列出repo
helm delete --purge <name> #删除某个应用
helm reset #重置helm
网友评论