大数跨境
0
0

如何部署 helm chart 私有化仓库

如何部署 helm chart 私有化仓库 GookSpin
2025-11-11
0
本文部署使用本地存储部署,需要使用 s3, minio, etcd等外部存储的可以参考官方文档 

https://chartmuseum.com/docs/#configuration


1、下载二进制文件

wget https://get.helm.sh/chartmuseum-v0.16.3-linux-amd64.tar.gz# arm 使用 https://get.helm.sh/chartmuseum-v0.16.3-linux-arm64.tar.gz


2、解压和创建目录

tar xvf chartmuseum-v0.16.3-linux-amd64.tar.gz  mv linux-amd64/chartmuseum  /usr/local/bin/ mkdir -p /data/chartstorage


3、配置启动 service 文件

cat >> /etc/systemd/system/chartmuseum.service  << EOF[Unit]Description=ChartMuseum - Helm Chart Repository ServerAfter=network.target[Service]Type=simpleUser=rootGroup=rootExecStart=/usr/local/bin/chartmuseum \  --port=5000 \  --storage="local" \  --storage-local-rootdir="/data/chartstorage" \  --basic-auth-user="root" \  --basic-auth-pass="asWzu40TFGi0IpRfAYse" \  --allow-overwrite \  --debugRestart=alwaysRestartSec=5sLimitNOFILE=65535[Install]WantedBy=multi-user.targetEOF
--port=5000
ChartMuseum 服务监听的端口(默认 8080,可自定义)
--storage="local"
指定存储类型为本地存储(也可以用 S3、GCS 等)
--storage-local-rootdir="/data/chartstorage"
本地 Chart 文件存储目录
--basic-auth-user="root"
启用基本认证(用户名)
--basic-auth-pass="asWzu40TFGi0IpRfAYse"
启用基本认证(密码)
--allow-overwrite
允许上传时覆盖同名 Chart
--debug
启用调试模式(输出更详细日志)


4、启动和开机自启

systemctl enable chartmuseum --now


5、配置 nginx 转发

nginx 转发比较简单,我这里使用了我线上安装好的宝塔直接配置


6、使用

helm repo add chartmuseum https://helmchart.xxxx.com \  --username root \  --password asWzu40TFGi0IpRfAYse
  helm plugin install https://github.com/chartmuseum/helm-push.git --verify=falseWARNING: Skipping plugin signature verificationDownloading and installing helm-push v0.10.4 ...https://github.com/chartmuseum/helm-push/releases/download/v0.10.4/helm-push_0.10.4_linux_arm64.tar.gzInstalled plugin: cm-push
helm plugin listNAME    VERSION TYPE            APIVERSION      PROVENANCE      SOURCE cm-push 0.10.4  getter/v1       legacy          unknown         unknown


7、配置 path

# vim /etc/profileexport PATH=$PATH:/root/.local/share/helm/plugins/helm-push.git/binsource /etc/profile


8、快速创建一个 helm chart

helm create test123Creating test123
9、上传 helm chart 到 helmrepo 中
[root@xx-xx ~]# helm repo listNAME            URL                            chartmuseum     https://helmchart.xxxx.com
[root@xx-xx ~]#  helm-cm-push  ./test123/ chartmuseumPushing test123-0.1.0.tgz to chartmuseum...Done.


10、发布部署服务

helm repo updatehelm install nginx chartmuseum/test123
kubectl get pod,svc 

11、 查看 helm repo 目录中的文件和索引文件






【声明】内容源于网络
0
0
GookSpin
运维技术文档分享
内容 3
粉丝 0
GookSpin 运维技术文档分享
总阅读0
粉丝0
内容3