安装 harbor,要注意开启 Helm Charts 功能
创建 自定义 Charts
接下文
1、打包
[root@master helmfile]# helm package myapp
2、查看,生成一个 tgz 格式的文件
[root@master helmfile]# ll
总用量 4
drwxr-xr-x 3 root root 79 2月 26 04:21 myapp
-rw-r--r-- 1 root root 831 2月 26 04:31 myapp-0.1.0.tgz
3、安装 push 插件
helm plugin install https://github.com/chartmuseum/helm-push
# 查看已成功
[root@jenkins ~]# helm plugin list
NAME VERSION DESCRIPTION
push 0.9.0 Push chart package to ChartMuseum
4、创建一个 charts 项目
5、添加仓库
helm repo add harbor https://harbor.mshxuyi.com/chartrepo/library
6、查看
[root@master helmfile]# helm repo list
NAME URL
aliyuncs https://apphub.aliyuncs.com
harbor https://harbor.mshxuyi.com/chartrepo/library
7、上传
[root@master helmfile]# helm push myapp-0.1.0.tgz harbor --username tomma --password Tomma@123
Pushing myapp-0.1.0.tgz to harbor_charts...
Done.
9、查看
10、安装
# 更新
helm repo update
# 安装
helm install myapp harbor/myapp
# 成功
NAME: myapp
LAST DEPLOYED: Fri Feb 26 04:53:21 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
11、相关错误解决
x509: certificate signed by unknown authority,安装的 harbor 是自建的证书,但是还是出现证书校验失败,https://blog.csdn.net/mshxuyi/article/details/114654740
解决方法:
把之前生成的 ca.crt 粘贴到 /etc/pki/tls/certs/ca-bundle.crt 最后一行