Harbor部署为Chart仓库
Harbor部署为Chart仓库
1:当前harbor环境已具备
[[email protected] harbor]#
[[email protected] harbor]# docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------------
chartmuseum /docker-entrypoint.sh Up 9999/tcp
harbor-core /harbor/harbor_core Up
harbor-db /docker-entrypoint.sh Up 5432/tcp
harbor-jobservice /harbor/harbor_jobservice ... Up
harbor-log /bin/sh -c /usr/local/bin/ ... Up 127.0.0.1:1514->10514/tcp
harbor-portal nginx -g daemon off; Up 8080/tcp
nginx nginx -g daemon off; Up 0.0.0.0:80->8080/tcp
redis redis-server /etc/redis.conf Up 6379/tcp
registry /entrypoint.sh /etc/regist ... Up 5000/tcp
registryctl /harbor/start.sh Up
[[email protected] harbor]#
2:启用Harbor的Chart仓库服务
[[email protected] harbor]#
[[email protected] harbor]#
[[email protected] harbor]# pwd
/software/harbor
[[email protected] harbor]# ./install.sh --with-chartmuseum
[Step 0]: checking installation environment ...
Note: docker version: 19.03.8
Note: docker-compose version: 1.18.0
[Step 1]: loading Harbor images ...
Loaded image: goharbor/redis-photon:v1.9.1
Loaded image: goharbor/registry-photon:v2.7.1-patch-2819-2553-v1.9.1
Loaded image: goharbor/harbor-registryctl:v1.9.1
Loaded image: goharbor/clair-photon:v2.0.9-v1.9.1
Loaded image: goharbor/harbor-migrator:v1.9.1
Loaded image: goharbor/chartmuseum-photon:v0.9.0-v1.9.1
Loaded image: goharbor/prepare:v1.9.1
Loaded image: goharbor/harbor-db:v1.9.1
Loaded image: goharbor/notary-server-photon:v0.6.1-v1.9.1
Loaded image: goharbor/harbor-jobservice:v1.9.1
Loaded image: goharbor/nginx-photon:v1.9.1
Loaded image: goharbor/notary-signer-photon:v0.6.1-v1.9.1
Loaded image: goharbor/harbor-portal:v1.9.1
Loaded image: goharbor/harbor-core:v1.9.1
Loaded image: goharbor/harbor-log:v1.9.1
[Step 2]: preparing environment ...
prepare base dir is set to /software/harbor
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registry/root.crt
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /secret/keys/secretkey
Generated configuration file: /config/chartserver/env
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir
Note: stopping existing Harbor instance ...
Stopping nginx ... done
Stopping harbor-jobservice ... done
Stopping harbor-core ... done
Stopping harbor-portal ... done
Stopping registry ... done
Stopping redis ... done
Stopping registryctl ... done
Stopping harbor-db ... done
Stopping harbor-log ... done
Removing nginx ... done
Removing harbor-jobservice ... done
Removing harbor-core ... done
Removing harbor-portal ... done
Removing registry ... done
Removing redis ... done
Removing registryctl ... done
Removing harbor-db ... done
Creating harbor-log ... done
Removing network harbor_harbor
Removing network harbor_harbor-chartmuseum
WARNING: Network harbor_harbor-chartmuseum not found.
Creating harbor-db ... done
Creating harbor-core ... done
Creating network "harbor_harbor-chartmuseum" with the default driver
Creating harbor-jobservice ... done
Creating harbor-portal ...
Creating chartmuseum ...
Creating registryctl ...
Creating registry ...
Creating redis ...
Creating harbor-db ...
Creating harbor-core ...
Creating nginx ...
Creating harbor-jobservice ...
? ----Harbor has been installed and started successfully.----
Now you should be able to visit the admin portal at http://node-11.
For more details, please visit https://github.com/goharbor/harbor .
[[email protected] harbor]#
启用后,默认创建的项目就带有helm charts功能了。
3:安装push插件
# helm plugin install https://github.com/chartmuseum/helm-push
4 :添加repo
[[email protected] ~]# helm repo add --username admin --password root123 myrepo http://100.100.100.100/chartrepo/library
"myrepo" has been added to your repositories
[[email protected] ~]#
[[email protected] ~]#
5: 推送与安装Chart
[[email protected] ~]# helm push mychart-0.1.0.tgz --username=admin --password=root123 http://100.100.100.100/chartrepo/library
Pushing mychart-0.1.0.tgz to http://10.83.35.11/chartrepo/library...
Done.
[[email protected] ~]#
[[email protected] ~]# helm push demo-0.1.0.tgz --username=admin --password=root123 http://100.100.100.100/chartrepo/library
Pushing demo-0.1.0.tgz to http://100.100.100.100/chartrepo/library...
Done.
[[email protected] ~]#
[[email protected] ~]#