【K8S专题】三、Harbor 私有镜像仓库安装配置

举报
全栈程序猿 发表于 2023/07/28 16:48:26 2023/07/28
【摘要】 首先需要按照前面的步骤,在环境上安装 Docker,才能安装 Harbor, 重新设置一台服务器 172.16.20.175,不要放在 K8S 的主从服务器上。 1、选择合适的版本进行下载,下载地址:https://github.com/goharbor/harbor/releases 2、解压tar -zxf harbor-offline-installer-v2.2.4.tgz 3、配置...

首先需要按照前面的步骤,在环境上安装 Docker,才能安装 Harbor, 重新设置一台服务器 172.16.20.175,不要放在 K8S 的主从服务器上。

1、选择合适的版本进行下载,下载地址:

https://github.com/goharbor/harbor/releases

2、解压

tar -zxf harbor-offline-installer-v2.2.4.tgz

3、配置

cd harbor

mv harbor.yml.tmpl harbor.yml

vi harbor.yml

4、将 hostname 改为当前服务器地址,注释掉 https 配置。

 ......

# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: 172.16.20.175

# http related config
http:
  # port for http, default is 80. If https enabled, this port will redirect to https port
  port: 80

# https related config
#https:
  # https port for harbor, default is 443
 # port: 443
  # The path of cert and key files for nginx
 # certificate: /your/certificate/path
 # private_key: /your/private/key/path

 ......

5、执行安装命令


mkdir /var/log/harbor/

./install.sh

6、查看安装是否成功

[root@localhost harbor]# docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS                             PORTS                                   NAMES
de1b702759e7        goharbor/harbor-jobservice:v2.2.4    "/harbor/entrypoint.…"   13 seconds ago      Up 9 seconds (health: starting)                                            harbor-jobservice
55b465d07157        goharbor/nginx-photon:v2.2.4         "nginx -g 'daemon of…"   13 seconds ago      Up 9 seconds (health: starting)    0.0.0.0:80->8080/tcp, :::80->8080/tcp   nginx
d52f5557fa73        goharbor/harbor-core:v2.2.4          "/harbor/entrypoint.…"   13 seconds ago      Up 10 seconds (health: starting)                                           harbor-core
4ba09aded494        goharbor/harbor-db:v2.2.4            "/docker-entrypoint.…"   13 seconds ago      Up 11 seconds (health: starting)                                           harbor-db
647f6f46e029        goharbor/harbor-portal:v2.2.4        "nginx -g 'daemon of…"   13 seconds ago      Up 11 seconds (health: starting)                                           harbor-portal
70251c4e234f        goharbor/redis-photon:v2.2.4         "redis-server /etc/r…"   13 seconds ago      Up 11 seconds (health: starting)                                           redis
21a5c408afff        goharbor/harbor-registryctl:v2.2.4   "/home/harbor/start.…"   13 seconds ago      Up 11 seconds (health: starting)                                           registryctl
b0937800f88b        goharbor/registry-photon:v2.2.4      "/home/harbor/entryp…"   13 seconds ago      Up 11 seconds (health: starting)                                           registry
d899e377e02b        goharbor/harbor-log:v2.2.4           "/bin/sh -c /usr/loc…"   13 seconds ago      Up 12 seconds (health: starting)   127.0.0.1:1514->10514/tcp               harbor-log

7、harbor 的启动停止命令

docker-compose down   #停止

docker-compose up -d  #启动

8、访问 harbor 管理台地址,上面配置的 hostname, http://172.16.20.175 (默认用户名/密码: admin/Harbor12345。

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。