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.gzmv 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 |
|
--storage="local" |
|
--storage-local-rootdir="/data/chartstorage" |
|
--basic-auth-user="root" |
|
--basic-auth-pass="asWzu40TFGi0IpRfAYse" |
|
--allow-overwrite |
|
--debug |
|
4、启动和开机自启
systemctl enable chartmuseum --now
5、配置 nginx 转发
nginx 转发比较简单,我这里使用了我线上安装好的宝塔直接配置
6、使用
helm repo add chartmuseum https://helmchart.xxxx.com \--username root \--password asWzu40TFGi0IpRfAYsehelm 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-pushhelm plugin listNAME VERSION TYPE APIVERSION PROVENANCE SOURCEcm-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
[]NAME URLchartmuseum https://helmchart.xxxx.com
[]Pushing test123-0.1.0.tgz to chartmuseum...Done.
10、发布部署服务
helm repo updatehelm install nginx chartmuseum/test123
kubectl get pod,svc
11、 查看 helm repo 目录中的文件和索引文件

