Helm install - xiaotiantian1132/k8s-install GitHub Wiki

Helm 安装

client:

desired version

 1:Download your desired version 
 2:Unpack it (tar -zxvf helm-v2.10.0-linux-amd64.tgz)
 3:Find the helm binary in the unpacked directory, and move it to its desired destination (mv linux-amd64/helm /usr/local/bin/helm)

tiller权限创建置

 $ kubectl create serviceaccount --namespace kube-system tiller
 $ kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller

server:

 使用阿里云镜像安装并把默认仓库设置为阿里云上的镜像仓库
 $ helm init --upgrade --tiller-image registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.9.1 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts

为tiller设置serviceAccount:

 $ kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

helm 更新

client

 $ 下载最新版本 同第一步操作替换

tiller

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

helm卸载:

 $ helm reset -f

helm部署&基本命令:

调试 chart

 $ helm lint 和 $ helm install --dry-run --debug <chart_dir>

 $ helm lint 会检测 chart 的语法,报告错误以及给出建议。

部署到k8s

 $ helm install -n <name> -f <yaml> <chart_dir> --namespace <namespace> --set <value>

更新release

 $ helm upgrade <name> -f <yaml> --set <value>

彻底删除部署的release

 $ helm delete --purge <release_name>

版本回滚

 $ helm rollback --debug mysql <version_number>

打包分享

 $ helm package

设置helm命令自动补全

 为了方便helm命令的使用,helm提供了自动补全功能,如果使用zsh请执行:

 $ source <(helm completion zsh)
 
 如果使用bash请执行:

 $ source <(helm completion bash)
⚠️ **GitHub.com Fallback** ⚠️