推送helm-chart到harbor仓库

前提

  1. 存在harbor仓库
  2. 已安装helm工具

实践

  1. 创建 Chart

    $ helm create hellow-world
    
    $ ls hellow-world/
    # Chart.yaml  charts  templates  values.yaml
    
  2. 安装插件并添加源

    • 在线安装
      $ helm plugin install https://github.com/chartmuseum/helm-push
      
    • 离线安装
      选择合适的版本 helm-push
      $ mkdir -p helm-push/
      $ tar -xzf helm-push_0.10.3_windows_amd64.tar.gz -C helm-push/
      
      # 查看 helm 环境变量
      $ helm env 
      # HELM_PLUGINS="/c/helm/plugins"
      
      # 复制插件到插件目录
      $ cp -r helm-push /c/helm/plugins
      
  3. 添加repo

    $ helm repo add dggecr01 http://machao.online/chartrepo/swbom-g-test/ \
    --username='robot$rw_man' \
    -password=eyJhbGciOiJSUzI1NiIsInR5c*******
    
  4. 打包chart

    $ helm package hellow-world/
    # Successfully packaged chart and saved it to: /......./hellow-world-0.1.0.tgz
    
  5. 上传chart

    helm cm-push hellow-world-0.1.0.tgz  \
    --username='robot$rw_man' \
    -password=eyJhbGciOiJSUzI1NiIsInR5c******* \
    http://machao.online/chartrepo/swbom-g-test/
    

你可能感兴趣的:(推送helm-chart到harbor仓库)