一、chart資源打包
helm package ./web-chart
# 當前目錄會生成一個tgz的壓縮文件
二、安裝help push插件(用于推送前面打包的文件,到鏡像倉庫)
.1 下載help-push二進制文件
wget https://github.com/chartmuseum/helm-push/releases/download/v0.9.0/helm-push_0.9.0_linux_amd64.tar.gz
.2 安裝到插件目錄
tar -zxvf helm-push_0.9.0_linux_amd64.tar.gz
# 拷貝bin目錄、plugin.yaml文件,到插件目錄:/root/.local/share/helm/plugins/helm-push(沒有則創建)
cp ./bin plugin.yaml /root/.local/share/helm/plugins/helm-push
.3 測試插件命令
# 添加倉庫
helm repo add --username admin --password Harbor12345 myrepo harbor倉庫地址
helm repo update
#推送
helm push web-chart-0.1.0.tgz --username=admin --password=Harbor12345 harbor倉庫地址
# 從倉庫獲取,安裝到k8s
helm install web --version 0.1.0 myrepo/web-chart