helm v3安装使用

每一个版本helm提供多种操作系统的二进制版本。这些二进制版本可以手动下载和安装。
添加命令补全
安装命令补全功能

yum install -y bash-completion
新增文件 /etc/profile.d/helm.sh,编辑以下内容:

source <(helm completion bash)
echo “source <(helm completion bash)” >> ~/.bashrc
生效环境变量配置:

source /etc/profile.d/helm.sh

添加公用的仓库
helm repo add stable http://mirror.azure.cn/kubernetes/charts
helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm repo update
指定对应的k8s集群
这一步非常关键,它是helm与k8s通讯的保证,这一步就是把k8s环境变量KUBECONFIG进行配置

注:v3版本不再需要Tiller,而是通过ApiServer与k8s交互,可以设置环境变量KUBECONFIG来指定存有ApiServre的地址与token的配置文件地址,默认为~/.kube/config

export KUBECONFIG=/root/.kube/config #可以写到/etc/profile里

下载,安装
wget https://get.helm.sh/helm-v3.4.2-linux-amd64.tar.gz

tar -zxvf helm-v3.4.2-linux-amd64.tar.gz

mv linux-amd64/helm /usr/local/bin/helm

查看版本
helm version

helm repo add stable https://apphub.aliyuncs.com

helm repo list

添加自建的 chartmuseum 仓库, 自建 chartmuseum 可参考 https://www.cnblogs.com/klvchen/p/13608804.html
helm repo add chartmuseum http://192.168.0.200:82
helm repo ls

创建自定义 chart
helm create yp-flask

测试
helm lint yp-flask
helm template yp-flask

打包
helm package yp-flask

上传
curl --data-binary “@yp-flask-0.1.0.tgz” http://192.168.0.200:82/api/charts

更新 repo
helm repo update
helm search repo chartmuseum

下载
curl -O http://192.168.0.200:82/charts/yp-flask-0.1.0.tgz

删除一个chart版本
curl -s -X DELETE http://192.168.0.200:82/api/charts/yp-flask/0.1.0

查看所有 chart
curl http://192.168.0.200:82/index.yaml

获取指定chart的依赖列表。
helm dependency list

根据requirements.yaml文件内容更新charts目录
helm dependency update

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值