3

Harbor DNSPOD 证书部署

 2 years ago
source link: http://www.chenshake.com/the-harbor-dnspod-certificate-deployment/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

 

简单描述一下环境

  • CentOS 7.9 vm
  • docker 20.10.7 : 阿里repo
  • docker compose: yum install docker-compose
  • IP地址:10.0.38.127
  • 主机域名:harbor.chenshake.site,确认ping 域名,可以返回IP地址:10.0.38.127
  • 免费域名ssl证书

由于域名在DNSPOD 上,所以申请证书,自动完成域名归属的确认问题,就省掉了一个确认的过程,直接下载回来就可以使用。最底下那条记录:dnsauth,就是用来验证域名是你的。

直接就可以下载当前域名的ssl证书,一个zip包。到时候上传到linux机器上就可以。

先提前准备一下,一个是docker的存储,一个是存放证书的目录。

mkdir -p /data/harbor
mkdir -p /data/cert
scp harbor.chenshake.site.zip [email protected]:/data/cert
unzip harbor.chenshake.site.zip 

看看解压后到情况,由于harbar的离线安装包,是采用nginx,所以你只需要把配置文件的路径指向Nginx就可以。

下载最新版本的离线安装包

wget https://github.com/goharbor/harbor/releases/download/v2.3.1/harbor-offline-installer-v2.3.1.tgz
tar zxvf harbor-offline-installer-v2.3.1.tgz
cd harbor
cp harbor.yml.tmpl harbor.yml

后面就是编辑这个yml文件,重点就是证书的路径和访问的主机名字。

# Configuration file of Harbor

# 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: harbor.chenshake.site

# 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: /data/cert/Nginx/1_harbor.chenshake.site_bundle.crt
  private_key: /data/cert/Nginx/2_harbor.chenshake.site.key

docker 存储路径

# The default data volume
data_volume: /data/harbor

密码你自己看着办。

./install.sh --with-chartmuseum

这个应该很快,几分钟搞定。

https://harbor.chenshake.site 直接访问,这可是信任证书。docker login,也是没问题。

github 加速的办法

#这里提供两个最常用的镜像地址:

https://github.com.cnpmjs.org
https://hub.fastgit.org

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK