K8S-镜像管理(安装harbor)

墨蓝 2023-07-26 05:27 14阅读 0赞

首先我现在我也不知道harbor是个什么东西?
后面会知道的。

先安装一下:
Centos7.x 虚拟机

下载

https://github.com/goharbor/harbor/
我这边下载的离线版本的

安装

查看版本

  1. [root@flinkhadoop harbor]# docker -v
  2. Docker version 1.13.1, build 7f2769b/1.13.1

发现版本比较老,那么更新一下

  1. yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
  2. yum remove docker-common-2:1.13.1-109.gitcccb291.el7.centos.x86_64
  3. yum install -y yum-utils
  4. -- 添加阿里云镜像
  5. yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
  6. -- 查看列表
  7. yum list docker-ce --showduplicates|sort -r

安装最新版本

  1. yum install docker-ce-18.06.3.ce-3.el7

查看当前版本

  1. [root@flinkhadoop harbor]# docker -v
  2. Docker version 18.06.3-ce, build d7080c1

启动docker

配置

1、 设置hostname
设置为外网ip

  1. hostname: 192.168.49.101

2、关闭https

  1. # https related config
  2. #https:
  3. # https port for harbor, default is 443
  4. # port: 443
  5. # The path of cert and key files for nginx
  6. #certificate: /your/certificate/path
  7. #private_key: /your/private/key/path

install

继续执行install

  1. [root@flinkhadoop harbor]# ./install.sh
  2. [Step 0]: checking if docker is installed ...
  3. Note: docker version: 18.06.3
  4. [Step 1]: checking docker-compose is installed ...
  5. Note: docker-compose version: 1.24.1
  6. [Step 2]: loading Harbor images ...
  7. Loaded image: goharbor/clair-adapter-photon:v1.0.1-v1.10.1
  8. Loaded image: goharbor/harbor-jobservice:v1.10.1
  9. Loaded image: goharbor/redis-photon:v1.10.1
  10. Loaded image: goharbor/notary-server-photon:v0.6.1-v1.10.1
  11. Loaded image: goharbor/clair-photon:v2.1.1-v1.10.1
  12. Loaded image: goharbor/harbor-log:v1.10.1
  13. Loaded image: goharbor/registry-photon:v2.7.1-patch-2819-2553-v1.10.1
  14. Loaded image: goharbor/notary-signer-photon:v0.6.1-v1.10.1
  15. Loaded image: goharbor/chartmuseum-photon:v0.9.0-v1.10.1
  16. Loaded image: goharbor/harbor-registryctl:v1.10.1
  17. Loaded image: goharbor/nginx-photon:v1.10.1
  18. Loaded image: goharbor/harbor-migrator:v1.10.1
  19. Loaded image: goharbor/prepare:v1.10.1
  20. Loaded image: goharbor/harbor-portal:v1.10.1
  21. Loaded image: goharbor/harbor-core:v1.10.1
  22. Loaded image: goharbor/harbor-db:v1.10.1
  23. [Step 3]: preparing environment ...
  24. [Step 4]: preparing harbor configs ...
  25. prepare base dir is set to /opt/harbor
  26. WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
  27. Generated configuration file: /config/log/logrotate.conf
  28. Generated configuration file: /config/log/rsyslog_docker.conf
  29. Generated configuration file: /config/nginx/nginx.conf
  30. Generated configuration file: /config/core/env
  31. Generated configuration file: /config/core/app.conf
  32. Generated configuration file: /config/registry/config.yml
  33. Generated configuration file: /config/registryctl/env
  34. Generated configuration file: /config/db/env
  35. Generated configuration file: /config/jobservice/env
  36. Generated configuration file: /config/jobservice/config.yml
  37. Generated and saved secret to file: /secret/keys/secretkey
  38. Generated certificate, key file: /secret/core/private_key.pem, cert file: /secret/registry/root.crt
  39. Generated configuration file: /compose_location/docker-compose.yml
  40. Clean up the input dir
  41. [Step 5]: starting Harbor ...
  42. Creating network "harbor_harbor" with the default driver
  43. Creating harbor-log ... done
  44. Creating harbor-db ... done
  45. Creating harbor-portal ... done
  46. Creating registry ... done
  47. Creating redis ... done
  48. Creating registryctl ... done
  49. Creating harbor-core ... done
  50. Creating nginx ... done
  51. Creating harbor-jobservice ... done
  52. ----Harbor has been installed and started successfully.----

结果

登录 admin/Harbor12345 (如果没有改密码的情况下)

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,14人围观)

还没有评论,来说两句吧...

相关阅读