警告
本文最后更新于 2020-06-17 18:43,文中内容可能已过时。
安装
下载客户端:
1
| wget https://get.helm.sh/helm-v2.10.0-linux-amd64.tar.gz
|
安装客户端:
1
2
| tar xf helm-v2.10.0-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/sbin/
|
安装tiller:
1
| helm init --tiller-image=registry.cn-shanghai.aliyuncs.com/soulchild/tiller:v2.10.0
|
通过helm version
查看安装结果
配置rbac:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| 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:
- name: tiller
kind: ServiceAccount
namespace: kube-system
|
指定pod的serviceaccount,也可以在初始化的时候加上–service-account参数
1
| kubectl patch deployments. -n kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
|
常用命令:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| #创建一个chart
helm create demo1
#检查chart是否正常
helm lint demo1/
#将chart打包
helm package demo1/
#安装一个chart
helm install demo1/
#查看release
helm ls
#查看历史release
helm ls -a
#删除release
helm delete dusty-condor
#删除历史release
helm delete dusty-condor --purge
#添加仓库
helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
#查看仓库列表
helm repo list
#更新仓库
helm repo update
#查找chart包
helm search mysql
#查看chart包详细信息
helm inspect aliyun/mariadb
|