Harbor:Harbor 安装

本文详细介绍在CentOS 7上安装Harbor的步骤,包括安装docker-compose及离线部署Harbor的过程。通过修改harbor.yml配置文件,执行安装脚本,最终实现Harbor的本地部署。

Harbor:Harbor 安装

简介:

官方文档: https://github.com/goharbor/harbor/blob/master/docs/installation_guide.md

本文参考:


环境:

  • CentOS Linux release 7.6.1810 (Core)

  • Docker version 18.09.3, build 774a1f4



创建时间:2019/6/5 9:37:01 

创建人:于子源

修改记录:修改人+修改时间+修改说明(多人修改时,增加多条)

当前版本:version 1.0.0

安装 docker-compose

  1. 安装 docker-compose

     sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    
  2. 授予执行权限:

     sudo chmod +x /usr/local/bin/docker-compose
    
  3. 测试安装

     $ docker-compose --version
     docker-compose version 1.24.0, build 1110ad01
    
  4. 原文 https://docs.docker.com/compose/install/

安装 harbor

  1. 先下载到 Windows host,再转移到 CentOS7 /opt/ 下

    下载离线版:https://github.com/goharbor/harbor/releases

  2. 离线安装

    tar xvf harbor-offline-installer-<version>.tgz

  3. 进入 harbor 文件夹,编辑 harbor.yml

    hostname: 修改为 hostname: 10.9.40.123。10.9.40.123 为我试验机的 IP。

  4. 执行 install.sh 脚本

    ./install.sh

  5. 访问 10.9.40.123:80

    https://10.9.40.123:80 or http://10.9.40.123/harbor

  6. 登录信息在 harbor.yml 文件中。

    默认为 root/Harbor123456


[root@master ~]# kubeadm init --config=init/init.yaml |tee init/init.log [init] Using Kubernetes version: v1.26.0 [preflight] Running pre-flight checks [preflight] Pulling images required for setting up a Kubernetes cluster [preflight] This might take a minute or two, depending on the speed of your internet connection [preflight] You can also perform this action in beforehand using 'kubeadm config images pull' error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR ImagePull]: failed to pull image harbor:443/k8s/kube-apiserver:v1.26.0: output: E0830 23:26:09.927762 39132 remote_image.go:242] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/kube-apiserver:v1.26.0\": failed to resolve reference \"harbor:443/k8s/kube-apiserver:v1.26.0\": failed to do request: Head \"https://harbor:443/v2/k8s/kube-apiserver/manifests/v1.26.0\": x509: certificate relies on legacy Common Name field, use SANs instead" image="harbor:443/k8s/kube-apiserver:v1.26.0" time="2025-08-30T23:26:09+08:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/kube-apiserver:v1.26.0\": failed to resolve reference \"harbor:443/k8s/kube-apiserver:v1.26.0\": failed to do request: Head \"https://harbor:443/v2/k8s/kube-apiserver/manifests/v1.26.0\": x509: certificate relies on legacy Common Name field, use SANs instead" , error: exit status 1 [ERROR ImagePull]: failed to pull image harbor:443/k8s/kube-controller-manager:v1.26.0: output: E0830 23:26:10.094555 39156 remote_image.go:242] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/kube-controller-manager:v1.26.0\": failed to resolve reference \"harbor:443/k8s/kube-controller-manager:v1.26.0\": failed to do request: Head \"https://harbor:443/v2/k8s/kube-controller-manager/manifests/v1.26.0\": x509: certificate relies on legacy Common Name field, use SANs instead" image="harbor:443/k8s/kube-controller-manager:v1.26.0" time="2025-08-30T23:26:10+08:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/kube-controller-manager:v1.26.0\": failed to resolve reference \"harbor:443/k8s/kube-controller-manager:v1.26.0\": failed to do request: Head \"https://harbor:443/v2/k8s/kube-controller-manager/manifests/v1.26.0\": x509: certificate relies on legacy Common Name field, use SANs instead" , error: exit status 1 [ERROR ImagePull]: failed to pull image harbor:443/k8s/kube-scheduler:v1.26.0: output: E0830 23:26:10.261775 39180 remote_image.go:242] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/kube-scheduler:v1.26.0\": failed to resolve reference \"harbor:443/k8s/kube-scheduler:v1.26.0\": failed to do request: Head \"https://harbor:443/v2/k8s/kube-scheduler/manifests/v1.26.0\": x509: certificate relies on legacy Common Name field, use SANs instead" image="harbor:443/k8s/kube-scheduler:v1.26.0" time="2025-08-30T23:26:10+08:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/kube-scheduler:v1.26.0\": failed to resolve reference \"harbor:443/k8s/kube-scheduler:v1.26.0\": failed to do request: Head \"https://harbor:443/v2/k8s/kube-scheduler/manifests/v1.26.0\": x509: certificate relies on legacy Common Name field, use SANs instead" , error: exit status 1 [ERROR ImagePull]: failed to pull image harbor:443/k8s/kube-proxy:v1.26.0: output: E0830 23:26:10.431133 39204 remote_image.go:242] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/kube-proxy:v1.26.0\": failed to resolve reference \"harbor:443/k8s/kube-proxy:v1.26.0\": failed to do request: Head \"https://harbor:443/v2/k8s/kube-proxy/manifests/v1.26.0\": x509: certificate relies on legacy Common Name field, use SANs instead" image="harbor:443/k8s/kube-proxy:v1.26.0" time="2025-08-30T23:26:10+08:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/kube-proxy:v1.26.0\": failed to resolve reference \"harbor:443/k8s/kube-proxy:v1.26.0\": failed to do request: Head \"https://harbor:443/v2/k8s/kube-proxy/manifests/v1.26.0\": x509: certificate relies on legacy Common Name field, use SANs instead" , error: exit status 1 [ERROR ImagePull]: failed to pull image harbor:443/k8s/pause:3.9: output: E0830 23:26:10.609840 39228 remote_image.go:242] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/pause:3.9\": failed to resolve reference \"harbor:443/k8s/pause:3.9\": failed to do request: Head \"https://harbor:443/v2/k8s/pause/manifests/3.9\": x509: certificate relies on legacy Common Name field, use SANs instead" image="harbor:443/k8s/pause:3.9" time="2025-08-30T23:26:10+08:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/pause:3.9\": failed to resolve reference \"harbor:443/k8s/pause:3.9\": failed to do request: Head \"https://harbor:443/v2/k8s/pause/manifests/3.9\": x509: certificate relies on legacy Common Name field, use SANs instead" , error: exit status 1 [ERROR ImagePull]: failed to pull image harbor:443/k8s/etcd:3.5.6-0: output: E0830 23:26:10.779002 39252 remote_image.go:242] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/etcd:3.5.6-0\": failed to resolve reference \"harbor:443/k8s/etcd:3.5.6-0\": failed to do request: Head \"https://harbor:443/v2/k8s/etcd/manifests/3.5.6-0\": x509: certificate relies on legacy Common Name field, use SANs instead" image="harbor:443/k8s/etcd:3.5.6-0" time="2025-08-30T23:26:10+08:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/etcd:3.5.6-0\": failed to resolve reference \"harbor:443/k8s/etcd:3.5.6-0\": failed to do request: Head \"https://harbor:443/v2/k8s/etcd/manifests/3.5.6-0\": x509: certificate relies on legacy Common Name field, use SANs instead" , error: exit status 1 [ERROR ImagePull]: failed to pull image harbor:443/k8s/coredns:v1.9.3: output: E0830 23:26:10.948539 39276 remote_image.go:242] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/coredns:v1.9.3\": failed to resolve reference \"harbor:443/k8s/coredns:v1.9.3\": failed to do request: Head \"https://harbor:443/v2/k8s/coredns/manifests/v1.9.3\": x509: certificate relies on legacy Common Name field, use SANs instead" image="harbor:443/k8s/coredns:v1.9.3" time="2025-08-30T23:26:10+08:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"harbor:443/k8s/coredns:v1.9.3\": failed to resolve reference \"harbor:443/k8s/coredns:v1.9.3\": failed to do request: Head \"https://harbor:443/v2/k8s/coredns/manifests/v1.9.3\": x509: certificate relies on legacy Common Name field, use SANs instead" , error: exit status 1 [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...` To see the stack trace of this error execute with --v=5 or higher [root@master ~]# nslookup harbor ;; connection timed out; no servers could be reached 如何解决上述问题?
最新发布
08-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值