当harbor升级到2.1之后,很多技巧就可以玩起来了哈,先来helm charts的管理。下一篇是ormb作AI模型管理。
一,helm增加helm push插件
- 如果可以连网
helm plugin install https://github.com/chartmuseum/helm-pus
- 如果不能连网
helm plugin install helm-push_0.9.0_linux_amd64.tar.gz
- 或是直接把helm-push_0.9.0_linux_amd64.tar.gz里的文件cp到$HELM_PLUGINS目录(此目录可以通过
helm env
命令获得)。
二,helm 增加harbor repo
helm repo add harbor-test-helm-repo --username=xxx --password=xxx http://harbor-test.demo.com.cn:8086/chartrepo/helm-repo
查看已有的repo
helm repo list
NAME URL
harbor-test-helm http://harbor.demo.com.cn:8086/chartrepo
harbor-test-helm-repo http://harbor-test.demo.com.cn:8086/chartrepo/helm-repo
harbor-test-helm_repo http://harbor-test.demo.com.cn:8086/chartrepo/helm_repo
三,helm搜索harbor里的charts
- 先更新本地charts缓存内容
helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "harbor-test-helm_repo" chart repository
...Successfully got an update from the "harbor-test-helm" chart repository
...Successfully got an update from the "harbor-test-helm-repo" chart repository
Update Complete. ⎈Happy Helming!⎈
- 在harbor repo时模糊搜索指定charts
helm search repo seldon
- 输出近似内容
NAME CHART VERSION APP VERSION DESCRIPTION
harbor-test-helm-repo/seldon-core-operator 1.5.1 Seldon Core CRD and controller helm chart for K...
harbor-test-helm-repo/seldon-mab 0.2.0 Chart to deploy a multi-armed bandits router ov...
harbor-test-helm/helm-repo/seldon-core-operator 1.5.1 Seldon Core CRD and controller helm chart for K...
harbor-test-helm/helm-repo/seldon-mab 0.2.0 Chart to deploy a multi-armed bandits router ov...
harbor-test-helm/helm_repo/seldon-core-operator 1.5.1 Seldon Core CRD and controller helm chart for K...
harbor-test-helm/helm_repo/seldon-mab 0.2.0 Chart to deploy a multi-armed bandits router ov...
harbor-test-helm/library/seldon-core-operator 1.5.1 Seldon Core CRD and controller helm chart for K...
harbor-test-helm/library/seldon-mab 0.2.0 Chart to deploy a multi-armed bandits router ov...
harbor-test-helm_repo/seldon-core-operator 1.5.1 Seldon Core CRD and controller helm chart for K...
harbor-test-helm_repo/seldon-mab 0.2.0 Chart to deploy a multi-armed bandits router ov...
四,helm push,将本地charts加入harbor charts
- 一种方式是直接上传charts文件夹
helm push seldon-mab harbor-test-helm
seldon-mab是charts目录
harbor-test-helm是harbor charts repo名称。 - 另一种是将charts package文件包push
helm push seldon-core-operator-1.5.1.tgz harbor-test-helm
这两种方式输出都类似:
Pushing seldon-mab-0.2.0.tgz to harbor-test-helm...
Done.
Pushing seldon-core-operator-1.5.1.tgz to harbor-test-helm...
Done.
五,下载helm应用charts
helm pull harbor-test-helm-repo/seldon-mab
- harbor-test-helm-repo表示harbor chart repo
- seldon-mab表示这个repo里的具体的charts
此命令将会在当前目录下,生成一个seldon-mab-0.2.0.tgz文件。
(我怀疑helm pull生成的文件和helm package文件是一样的,一个从远程,一个从本地)
六,helm安装应用
也有两种方式
- 从远程harbor charts repo安装
helm install seldon-mab harbor-test-helm-repo/seldon-mab
seldon-mab这是命名,必须的,要不然要自动产生名字--generate-name - 从本地目录或压缩文件安装
helm install seldon-core-operator-1.5.1.tgz
查看已安装charts
helm list
输出
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
seldon-mab default 1 2021-01-13 15:01:16.59675153 +0800 CST deployed seldon-mab-0.2.0
七,删除helm charts应用
helm uninstall seldon-mab
seldon-mab即为charts name。如果有namespace,也需要加上。
网友评论