harbor部署

Posted 还行少年

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了harbor部署相关的知识,希望对你有一定的参考价值。

一、环境

主机名IP地址操作系统harbor版本
K8s-Master192.168.10.236Centos 7harbor1.8.0
K8s-Master192.168.10.236Centos 7harbor1.8.6

二、部署

1、下载安装包

[root@K8s-Master ~]# wget https://storage.googleapis.com/harbor-releases/release-1.8.0/harbor-offline-installer-v1.8.0.tgz
--2022-03-23 13:56:12--  https://storage.googleapis.com/harbor-releases/release-1.8.0/harbor-offline-installer-v1.8.0.tgz
Resolving storage.googleapis.com (storage.googleapis.com)... 172.217.163.48, 142.251.43.16, 142.251.42.240
Connecting to storage.googleapis.com (storage.googleapis.com)|172.217.163.48|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 552897681 (527M) [application/x-tar]
Saving to: ‘harbor-offline-installer-v1.8.0.tgz’

100%[========================================================================================================================>] 552,897,681 17.3MB/s   in 36s    

2022-03-23 13:56:48 (14.8 MB/s) - ‘harbor-offline-installer-v1.8.0.tgz’ saved [552897681/552897681]

2、解压

[root@K8s-Master ~]# tar xf harbor-offline-installer-v1.8.0.tgz 
[root@K8s-Master ~]# cd harbor/
[root@K8s-Master harbor]# ls
harbor.v1.8.0.tar.gz  harbor.yml  install.sh  LICENSE  prepare

3、修改配置文件

[root@K8s-Master harbor]# grep -v "#" harbor.yml | sed '/^[  ]*$/d'
hostname: 192.168.10.236
http:
  port: 80
harbor_admin_password: Harbor12345
database:
  password: root123
data_volume: /data/harbor
clair: 
  updaters_interval: 12
  http_proxy:
  https_proxy:
  no_proxy: 127.0.0.1,localhost,core,registry
jobservice:
  max_job_workers: 10
chart:
  absolute_url: disabled
log:
  level: info
  rotate_count: 50
  rotate_size: 200M
  location: /var/log/harbor
_version: 1.8.0
[root@K8s-Master harbor]# 

4、安装docker-compose(不装会报错)

[root@K8s-Master ~]# wget https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)
--2022-03-23 14:21:32--  https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/15045751/95c8d700-fe8e-11ea-99bf-c46b4884fe50?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220323%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220323T062239Z&X-Amz-Expires=300&X-Amz-Signature=3a83e45d0307aa60c57e3201d93f5a9e72c76889bd705915345682c361e5c850&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=15045751&response-content-disposition=attachment%3B%20filename%3Ddocker-compose-Linux-x86_64&response-content-type=application%2Foctet-stream [following]
--2022-03-23 14:21:32--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/15045751/95c8d700-fe8e-11ea-99bf-c46b4884fe50?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220323%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220323T062239Z&X-Amz-Expires=300&X-Amz-Signature=3a83e45d0307aa60c57e3201d93f5a9e72c76889bd705915345682c361e5c850&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=15045751&response-content-disposition=attachment%3B%20filename%3Ddocker-compose-Linux-x86_64&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.108.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12218968 (12M) [application/octet-stream]
Saving to: ‘docker-compose-Linux-x86_64’

100%[========================================================================================================================>] 12,218,968  45.4KB/s   in 5m 29s 

2022-03-23 14:27:02 (36.2 KB/s) - ‘docker-compose-Linux-x86_64’ saved [12218968/12218968]

[root@K8s-Master ~]# mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
[root@K8s-Master ~]# chmod +x /usr/local/bin/docker-compose


5、执行安装脚本

[root@K8s-Master harbor]# bash install.sh 

[Step 0]: checking installation environment ...

Note: docker version: 20.10.12

Note: docker-compose version: 1.27.4

[Step 1]: loading Harbor images ...
23d9f72a5270: Loading layer [==================================================>]  33.25MB/33.25MB
1d4a1da12c02: Loading layer [==================================================>]  50.51MB/50.51MB
8eb1a006f3b0: Loading layer [==================================================>]  3.584kB/3.584kB
41b6f75847f4: Loading layer [==================================================>]  3.072kB/3.072kB
ec9bd6e4d4e8: Loading layer [==================================================>]   2.56kB/2.56kB
6d852bb664c2: Loading layer [==================================================>]  3.072kB/3.072kB
0e4ed2b5a5b8: Loading layer [==================================================>]  3.584kB/3.584kB
8dfb2b644f30: Loading layer [==================================================>]  12.29kB/12.29kB
Loaded image: goharbor/harbor-log:v1.8.0
d8c53538042b: Loading layer [==================================================>]  63.34MB/63.34MB
1b5fb7ee22e0: Loading layer [==================================================>]  47.96MB/47.96MB
a8bdca5e9d71: Loading layer [==================================================>]  6.656kB/6.656kB
f7cec940b52c: Loading layer [==================================================>]  2.048kB/2.048kB
301a4a2af7db: Loading layer [==================================================>]   7.68kB/7.68kB
e588e1e3a775: Loading layer [==================================================>]   2.56kB/2.56kB
539f28a5d0ea: Loading layer [==================================================>]   2.56kB/2.56kB
8b4a72241226: Loading layer [==================================================>]   2.56kB/2.56kB
Loaded image: goharbor/harbor-db:v1.8.0
c88db349fb2f: Loading layer [==================================================>]  8.972MB/8.972MB
1f2d4d72bba2: Loading layer [==================================================>]  35.77MB/35.77MB
dddbcf598df5: Loading layer [==================================================>]  2.048kB/2.048kB
0ced476c2d9c: Loading layer [==================================================>]  3.072kB/3.072kB
af24eb0bf40b: Loading layer [==================================================>]  35.77MB/35.77MB
Loaded image: goharbor/chartmuseum-photon:v0.8.1-v1.8.0
b185d348bd7d: Loading layer [==================================================>]   2.56kB/2.56kB
f032ded7f92e: Loading layer [==================================================>]  1.536kB/1.536kB
c6c822edbc47: Loading layer [==================================================>]   66.9MB/66.9MB
73ef3c4363bf: Loading layer [==================================================>]  39.75MB/39.75MB
0c490e002448: Loading layer [==================================================>]  144.4kB/144.4kB
31afe2abafb4: Loading layer [==================================================>]  3.004MB/3.004MB
Loaded image: goharbor/prepare:v1.8.0
257ebcc1c9c4: Loading layer [==================================================>]  8.967MB/8.967MB
7579d3c94fca: Loading layer [==================================================>]  38.68MB/38.68MB
323611f7dd17: Loading layer [==================================================>]  38.68MB/38.68MB
Loaded image: goharbor/harbor-jobservice:v1.8.0
587a5757a7f6: Loading layer [==================================================>]  3.548MB/3.548MB
Loaded image: goharbor/nginx-photon:v1.8.0
a61ab2060e6e: Loading layer [==================================================>]  8.967MB/8.967MB
25359ae00f57: Loading layer [==================================================>]  5.143MB/5.143MB
610a1668f8bf: Loading layer [==================================================>]  15.13MB/15.13MB
db2252abd9e0: Loading layer [==================================================>]  26.47MB/26.47MB
4f406312560b: Loading layer [==================Docker容器——harbor私有仓库部署与管理

基于https的harbor部署与升级

基于https的harbor部署与升级

基于https的harbor部署与升级

Docker-harbor私有仓库部署与管理

Docker-harbor私有仓库部署与管理