k8s安装helm

下载安装包,并解压

wget https://get.helm.sh/helm-v2.15.2-linux-amd64.tar.gz
tar -xvf helm-v2.15.2-linux-amd64.tar.gz
cd helm-v2.15.2-linux-amd64/
cp helm /usr/local/bin/

初始化Helm 并安装tiller

Tiller是helm的服务器端,一般运行于kubernetes集群之上,定义tiller的ServiceAccount,并通过ClusterRoleBinding将其绑定至集群管理员角色cluster-admin,从而使得它拥有集群级别所有的最高权限

# tiller-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 tiller-rbac.yaml

用helm命令初始化并安装tiller

helm init --upgrade --service-account tiller  --tiller-image registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.15.2 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts

一旦安装了 Tiller,运行 helm version 会显示客户端和服务器版本

helm version

可以在kube-system命名空间看到tiller已经部署

kubectl get pods -n kube-system | grep tiller

删除tiller

kubectl -n kube-system delete deploy tiller-deploy
posted @ 2021-07-01 23:51  温茶又折花  阅读(307)  评论(0编辑  收藏  举报