searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享
原创

helm基于harbor的chart拉取和推送

2023-07-20 02:50:49
44
0

1、添加helm的仓库

在已经安装的harbor的机器上,获取habror的ip、port以及harbor的用户名和密码。

执行以下命令添加仓库,指定habror用户和密码,并且指定需要拉取和推送的harbor仓库名(这里以plugins为例):

helm repo add myrepo --username=xxx  --password=xxx  http://ip:port/chartrepo/plugins

执行无误后,运行helm repo list,可查看到已添加的repo仓库

# helm repo list
NAME                  	URL                                               
myrepo         	       http://ip:port/chartrepo/plugins     

2、拉取harbor中的chart包到本地目录

执行以下命令,保证helm仓库是最新的数据

helm repo update

首先保证harbor的plugins仓库中有mychart:1.0.0的chart包,myrepo是上述创建的仓库名,执行以下命名拉取harbor中的chart到当前目录下

helm pull myrepo/mychart  --version 1.0.0 

3、推送本地chart包到远程harbor仓库中

推送chart前,需要先安装helm的插件工具。helm-push的0.10版本之后,插件名称改为了cm-push

在线安装helm-push,安装成功后通过helm plugin list命令可以查看到cm-push信息

helm plugin install https://github.com/chartmuseum/helm-push

# helm plugin list
NAME   	VERSION	DESCRIPTION                      
cm-push	0.10.2 	Push chart package to ChartMuseum

离线下载helm-push包

下载地址:https://github.com/chartmuseum/helm-push/tags

执行helm env,查看HELM_PLUGINS的路径为/xxxx/helm/plugins,以0.10.2版本为例,解压helm-push包到指定目录下

helm env
mkdir /xxxx/helm/plugins/helm-push
cp helm-push_0.10.2_linux_amd64.tar.gz /xxxx/helm/plugins/helm-push
cd /xxxx/helm/plugins/helm-push

tar zxvf helm-push_0.10.2_linux_amd64.tar.gz 
helm plugin list

推送本地目录mychart.-1.0.0.tgz包到harbor的myrepo仓库中

helm cm-push mychart-1.0.0.tgz myrepo
0条评论
0 / 1000
j****n
1文章数
0粉丝数
j****n
1 文章 | 0 粉丝
j****n
1文章数
0粉丝数
j****n
1 文章 | 0 粉丝
原创

helm基于harbor的chart拉取和推送

2023-07-20 02:50:49
44
0

1、添加helm的仓库

在已经安装的harbor的机器上,获取habror的ip、port以及harbor的用户名和密码。

执行以下命令添加仓库,指定habror用户和密码,并且指定需要拉取和推送的harbor仓库名(这里以plugins为例):

helm repo add myrepo --username=xxx  --password=xxx  http://ip:port/chartrepo/plugins

执行无误后,运行helm repo list,可查看到已添加的repo仓库

# helm repo list
NAME                  	URL                                               
myrepo         	       http://ip:port/chartrepo/plugins     

2、拉取harbor中的chart包到本地目录

执行以下命令,保证helm仓库是最新的数据

helm repo update

首先保证harbor的plugins仓库中有mychart:1.0.0的chart包,myrepo是上述创建的仓库名,执行以下命名拉取harbor中的chart到当前目录下

helm pull myrepo/mychart  --version 1.0.0 

3、推送本地chart包到远程harbor仓库中

推送chart前,需要先安装helm的插件工具。helm-push的0.10版本之后,插件名称改为了cm-push

在线安装helm-push,安装成功后通过helm plugin list命令可以查看到cm-push信息

helm plugin install https://github.com/chartmuseum/helm-push

# helm plugin list
NAME   	VERSION	DESCRIPTION                      
cm-push	0.10.2 	Push chart package to ChartMuseum

离线下载helm-push包

下载地址:https://github.com/chartmuseum/helm-push/tags

执行helm env,查看HELM_PLUGINS的路径为/xxxx/helm/plugins,以0.10.2版本为例,解压helm-push包到指定目录下

helm env
mkdir /xxxx/helm/plugins/helm-push
cp helm-push_0.10.2_linux_amd64.tar.gz /xxxx/helm/plugins/helm-push
cd /xxxx/helm/plugins/helm-push

tar zxvf helm-push_0.10.2_linux_amd64.tar.gz 
helm plugin list

推送本地目录mychart.-1.0.0.tgz包到harbor的myrepo仓库中

helm cm-push mychart-1.0.0.tgz myrepo
文章来自个人专栏
文章 | 订阅
0条评论
0 / 1000
请输入你的评论
0
0