harbor中helm的使用

发布时间 2023-06-01 14:13:05作者: 潇潇暮鱼鱼

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包/helm目录 仓库名