1、helm安装
软件准备
helm v2由客户端helm cli工具和服务器tiller两部分组成。
下载地址:https://storage.googleapis.com/kubernetes-helm/helm-v2.11.0-linux-amd64.tar.gz
release地址:https://github.com/helm/helm/releases
运行tiller服务器
本地运行直接执行tiller即可 ./tiller
初始化helm
helm init --client-only #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/repository/repositories.yaml #$HELM_HOME has been configured at /root/.helm.
参数:
--client-only:只初始化helm,不在集群内安装tiller,只会在helm home目录下创建配置文件
--home:helm 文件存储目录,默认/root/.helm,若初始化时修改了该参数,后续的helm调用也需要指定home路径。因此可直接修改环境变量$HELM_HOME来实现。
2.helm push 安装
helm-push插件地址 https://github.com/chartmuseum/helm-push/
下载后,将其解压到.helm/plugins/helm-push.git下
3、helm常用命令
helm install --name test . 在chart目录内,部署chart
helm del --purge test 删除test部署
helm push mychart-0.1.0.tgz repo 上传chart包
helm repo add --username username --password password repo_name repo_address/username | 增加repo |
helm repo list | 列举已添加的charts repo |
helm repo remove repo_name | 移除repo |
helm search keyword -l | 列出repo提供的带有关键字的模板 |
helm fetch --version version repo/chart_name | 下载模板到本地 |
helm install /root/testlink-4.0.1.tgz --tls | 安装模板实例 |
helm list --tls | 列出所有仓库的charts实例 |
helm plugin install https://github.com/chartmuseum/helm-push |
导出配置文件:
导出proxy
kubectl get ds -n kube-system -l k8s-app=kube-proxy -o yaml>kube-proxy-ds.yaml
导出kube-dns
kubectl get deployment -n kube-system -l k8s-app=kube-dns -o yaml >kube-dns-dp.yaml
kubectl get services -n kube-system -l k8s-app=kube-dns -o yaml >kube-dns-services.yaml
导出所有 configmap
kubectl get configmap -n kube-system -o wide -o yaml > configmap.yaml