harbor中helm的使用

1.在harbor安装的时候需要开启chart模块

./install.sh --with-chartmuseum

2.在启动harbor之后会在harbor项目中出现helm charts,创建一个名为helm-repo的公开项目用于存放helm项目

 3.在服务器添加chart仓库,其中ca.pem是harbor的根证书,xx.com.crt和xx.com.key分别为harbor的证书和私钥。helm repo add 中的账户密码不能用缩写-u -p只能用全写,而且由于密码中有特殊符号,所以要用''包起来。因为本harbor仓库使用https需要ssl认证,且上传需要harbor的仓库与密码,所以需要--ca-file,--cert-file,--key-file; --username --password

helm repo add  gwhelm https://harbor.xx.com/chartrepo/helm-repo  --ca-file ca.pem --cert-file xx.com.crt --key-file xx.com.key  --username 'xxx' --password 'xxxxx' 

其中根证书可以在火狐浏览器harbor页面网址左边小锁的根证书中找到根证书的下载链接

 

4.安装cm-push插件

在线安装  helm plugin install https://github.com/chartmuseum/helm-push 安装不上

离线安装

安装包地址https://github.com/chartmuseum/helm-push/releases/

选择linux amd64进行下载,如果还下不下来可以搜github加速,使用文件下载加速网站https://gh.api.99988866.xyz/进行下载

 

helm env查看plugins目录,在该目录下面创建helm-push目录 

 将下载的helm-push_0.10.3_linux_amd64.tar.gz在/root/.local/share/helm/plugins/helm-push/中进行解压,此时查看helm plugin list ,已经有了cm-push插件,可以使用helm cm-push进行上传

 5.推送chart到harbor,可以使用helm cm-push tgz包/chart目录 仓库名

 6.下载使用helm

helm pull gwhelm/redis --version 17.3.7

tar -zxvf redis-17.3.7.tgz

修改values.yaml

干跑测试,其中xx-redis为项目名, ./redis为chart目录,如果不做values的修改也可以直接使用redis-17.3.7.tgz进行安装helm install xx-redis redis-17.3.7.tgz--dry-run  -n xx

helm install xx-redis ./redis --dry-run  -n xx

部署

helm install xx-redis ./redis  -n xx

卸载

helm uninstall/delete xx-redis -n xx

posted @   潇潇暮鱼鱼  阅读(770)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示