六.安装harbor

1、下载

harbor-offline-installer-v1.9.3

链接:https://pan.baidu.com/s/1dTCy2KPqRhYKxTyE7vlrPg 
提取码:6666

需要安装docker-compose

六.安装harbor_第1张图片

2、修改配置 

 vim harbor.yml

修改hostname和port

六.安装harbor_第2张图片

3、安装 

[root@localhost harbor]# ./prepare 
prepare base dir is set to /opt/k8s/devops/harbor/harbor
Unable to find image 'goharbor/prepare:v1.9.3' locally
v1.9.3: Pulling from goharbor/prepare
b950b5dd94ab: Pull complete 
b4a43e6420e8: Pull complete 
23c5a3d9ec9d: Pull complete 
234a8675eb24: Pull complete 
2421ffb0f054: Pull complete 
b6eb06812efc: Pull complete 
70c5107c831f: Pull complete 
Digest: sha256:d7d2117e425fd35f2e92fd9dab95e6041e603c128d93fa312415d53294812064
Status: Downloaded newer image for goharbor/prepare:v1.9.3
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
Generated and saved secret to file: /secret/keys/secretkey
Generated certificate, key file: /secret/core/private_key.pem, cert file: /secret/registry/root.crt
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir
[root@localhost harbor]# ./install.sh 

[Step 0]: checking installation environment ...

Note: docker version: 24.0.5

Note: docker-compose version: 2.5.0

[Step 1]: loading Harbor images ...
f93c083be5bc: Loading layer [==================================================>]  9.009MB/9.009MB
bf1b03029526: Loading layer [==================================================>]  44.41MB/44.41MB
3395eb0db37a: Loading layer [==================================================>]  2.048kB/2.048kB
630606b67737: Loading layer [==================================================>]  3.072kB/3.072kB
b59ccb3639e4: Loading layer [==================================================>]  44.41MB/44.41MB
Loaded image: goharbor/chartmuseum-photon:v0.9.0-v1.9.3
Loaded image: goharbor/prepare:v1.9.3
e80aab7b0662: Loading layer [==================================================>]  63.49MB/63.49MB
f8b3d119e8a9: Loading layer [==================================================>]  54.42MB/54.42MB
5f496dd4633b: Loading layer [==================================================>]  5.632kB/5.632kB
9a2858fea72d: Loading layer [==================================================>]  2.048kB/2.048kB
b7501a88cd95: Loading layer [==================================================>]   2.56kB/2.56kB
c82e3969a2e2: Loading layer [==================================================>]   2.56kB/2.56kB
7cac869555ad: Loading layer [==================================================>]   2.56kB/2.56kB
cca577be763d: Loading layer [==================================================>]  10.24kB/10.24kB
Loaded image: goharbor/harbor-db:v1.9.3
9a508de7d2b7: Loading layer [==================================================>]  9.005MB/9.005MB
508382d944be: Loading layer [==================================================>]  3.072kB/3.072kB
6e9e3cb5d33e: Loading layer [==================================================>]   2.56kB/2.56kB
73ddaf5bf2d0: Loading layer [==================================================>]  21.76MB/21.76MB
9a276490655f: Loading layer [==================================================>]  21.76MB/21.76MB
Loaded image: goharbor/registry-photon:v2.7.1-patch-2819-2553-v1.9.3
4a0251807cc9: Loading layer [==================================================>]  9.004MB/9.004MB
897af7ff7b63: Loading layer [==================================================>]  6.239MB/6.239MB
3f4123d93010: Loading layer [==================================================>]   14.9MB/14.9MB
4e0bdb09cba5: Loading layer [==================================================>]  29.21MB/29.21MB
29c5283b24ee: Loading layer [==================================================>]  22.02kB/22.02kB
6f09075fda1a: Loading layer [==================================================>]  50.34MB/50.34MB
Loaded image: goharbor/notary-signer-photon:v0.6.1-v1.9.3
756ffb58fa91: Loading layer [==================================================>]  7.037MB/7.037MB
733009a88a23: Loading layer [==================================================>]  196.6kB/196.6kB
5cc05e9a6a60: Loading layer [==================================================>]    172kB/172kB
eabe1b3a567b: Loading layer [==================================================>]  15.36kB/15.36kB
dd83cfe76436: Loading layer [==================================================>]  3.584kB/3.584kB
28bde9e732c9: Loading layer [==================================================>]  10.84MB/10.84MB
Loaded image: goharbor/harbor-portal:v1.9.3
0eb10921ee80: Loading layer [==================================================>]  78.25MB/78.25MB
74a7ce2b0571: Loading layer [==================================================>]  3.072kB/3.072kB
7d193a1c54ab: Loading layer [==================================================>]   59.9kB/59.9kB
d45413cea5ea: Loading layer [==================================================>]  61.95kB/61.95kB
Loaded image: goharbor/redis-photon:v1.9.3
7c53cafac35a: Loading layer [==================================================>]  337.9MB/337.9MB
c6bad7449208: Loading layer [==================================================>]  119.8kB/119.8kB
Loaded image: goharbor/harbor-migrator:v1.9.3
4bb3c8da2619: Loading layer [==================================================>]   50.3MB/50.3MB
fa60bb5fba7f: Loading layer [==================================================>]  3.584kB/3.584kB
12a81f321c68: Loading layer [==================================================>]  3.072kB/3.072kB
a94dcd551900: Loading layer [==================================================>]   2.56kB/2.56kB
c684117da188: Loading layer [==================================================>]  3.072kB/3.072kB
f14e11ea2c25: Loading layer [==================================================>]  3.584kB/3.584kB
2e2e439cb618: Loading layer [==================================================>]  12.29kB/12.29kB
Loaded image: goharbor/harbor-log:v1.9.3
99ce145e19e6: Loading layer [==================================================>]  10.84MB/10.84MB
Loaded image: goharbor/nginx-photon:v1.9.3
da7ad744c6fd: Loading layer [==================================================>]   16.4MB/16.4MB
a03cee9d5ed3: Loading layer [==================================================>]  29.21MB/29.21MB
f5f37ba098b1: Loading layer [==================================================>]  22.02kB/22.02kB
c6e237d0effb: Loading layer [==================================================>]  51.85MB/51.85MB
Loaded image: goharbor/notary-server-photon:v0.6.1-v1.9.3
01d39dbfbd65: Loading layer [==================================================>]  115.7MB/115.7MB
6d1186763503: Loading layer [==================================================>]  12.31MB/12.31MB
293c8dc3d8c6: Loading layer [==================================================>]  2.048kB/2.048kB
d0ffe0bb8b6b: Loading layer [==================================================>]  48.13kB/48.13kB
c9f0ab7d8bbb: Loading layer [==================================================>]  3.072kB/3.072kB
75c4044a879b: Loading layer [==================================================>]  12.36MB/12.36MB
Loaded image: goharbor/clair-photon:v2.1.0-v1.9.3
b2329d5f99cf: Loading layer [==================================================>]  12.77MB/12.77MB
17c27eb4f7f8: Loading layer [==================================================>]   55.4MB/55.4MB
3c10f4815fc0: Loading layer [==================================================>]  5.632kB/5.632kB
5fb810768754: Loading layer [==================================================>]  36.35kB/36.35kB
376871497fae: Loading layer [==================================================>]   55.4MB/55.4MB
Loaded image: goharbor/harbor-core:v1.9.3
2c38bb39e841: Loading layer [==================================================>]  12.77MB/12.77MB
20ef2473aa7f: Loading layer [==================================================>]  48.13MB/48.13MB
Loaded image: goharbor/harbor-jobservice:v1.9.3
bc526ee3d965: Loading layer [==================================================>]  9.005MB/9.005MB
d880cff24505: Loading layer [==================================================>]  3.072kB/3.072kB
adc7407dd64d: Loading layer [==================================================>]  21.76MB/21.76MB
aa1f551082be: Loading layer [==================================================>]  3.072kB/3.072kB
97bd8288c3d1: Loading layer [==================================================>]  8.661MB/8.661MB
f184a9da0594: Loading layer [==================================================>]  30.42MB/30.42MB
Loaded image: goharbor/harbor-registryctl:v1.9.3


[Step 2]: preparing environment ...
prepare base dir is set to /opt/k8s/devops/harbor/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/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: /compose_location/docker-compose.yml
Clean up the input dir



[Step 3]: starting Harbor ...
[+] Running 10/10
 ⠿ Network harbor_harbor        Created                                                                                                                                               0.1s
 ⠿ Container harbor-log         Started                                                                                                                                               0.9s
 ⠿ Container harbor-portal      Started                                                                                                                                               2.4s
 ⠿ Container harbor-db          Started                                                                                                                                               2.3s
 ⠿ Container redis              Started                                                                                                                                               2.4s
 ⠿ Container registry           Started                                                                                                                                               2.3s
 ⠿ Container registryctl        Started                                                                                                                                               2.1s
 ⠿ Container harbor-core        Started                                                                                                                                               2.7s
 ⠿ Container nginx              Started                                                                                                                                               3.4s
 ⠿ Container harbor-jobservice  Started                                                                                                                                               3.5s

✔ ----Harbor has been installed and started successfully.----

Now you should be able to visit the admin portal at http://192.168.3.186. 
For more details, please visit https://github.com/goharbor/harbor .

http://192.168.3.186:8858/     admin  123456

4.docker登录

vim /etc/docker/daemon.json

写入

"insecure-registries":["http://192.168.3.186:8858"]

 

[root@localhost harbor]# systemctl daemon-reload
[root@localhost harbor]# systemctl restart docker
#重启harbor
[root@localhost harbor]# docker-compose restart
[+] Running 9/9
 ⠿ Container harbor-log         Started                                                                                                                                              10.8s
 ⠿ Container registryctl        Started                                                                                                                                              10.9s
 ⠿ Container redis              Started                                                                                                                                               0.7s
 ⠿ Container harbor-db          Started                                                                                                                                              10.9s
 ⠿ Container registry           Started                                                                                                                                              11.0s
 ⠿ Container harbor-portal      Started                                                                                                                                               0.7s
 ⠿ Container harbor-core        Started                                                                                                                                               0.4s
 ⠿ Container harbor-jobservice  Started                                                                                                                                               2.6s
 ⠿ Container nginx              Started  

[root@localhost harbor]# docker login http://192.168.3.186:8858
Username: admin
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

你可能感兴趣的:(k8s,k8s)