liaochaowu 2020-06-06
[ ~]# mkdir -p /opt/src [ ~]# cd /opt/src [ src]# ll total 566428 -rw-r--r-- 1 root root 580021898 Apr 1 18:46 harbor-offline-installer-v1.8.3.tgz [ src]# tar xf harbor-offline-installer-v1.8.3.tgz -C /opt/ # 把软件包做版本标识,做一个软链接,便于以后升级 [ src]# cd .. [ opt]# mv harbor/ harbor-v1.8.0 [ opt]# ln -s /opt/harbor-v1.8.0/ /opt/harbor [ opt]# ll total 0 drwxr-xr-x 2 root root 71 Jun 6 11:19 certs drwx--x--x 4 root root 28 Jun 6 11:43 containerd lrwxrwxrwx 1 root root 19 Jun 6 11:57 harbor -> /opt/harbor-v1.8.0/ drwxr-xr-x 2 root root 100 Jun 6 11:57 harbor-v1.8.0 drwxr-xr-x 2 root root 49 Jun 6 11:55 src 编辑harbor文件 [ opt]# cd harbor [ harbor]# vi harbor.yml 5 hostname: harbor.od.com 10 port: 180 27 harbor_admin_password: Harbor12345 40 data_volume: /data/harbor 87 location: /data/harbor/logs # 更改日志存储路径 [ harbor]# mkdir -p /data/harbor/logs 单机编排工具 [ harbor]# yum install -y docker-compose [ harbor]# rpm -qa docker-compose docker-compose-1.18.0-4.el7.noarch 安装 [ harbor]# ./install.sh [ harbor]# docker-compose ps 每次重启docker需要执行也可以通过脚本方式启动 [ harbor]# docker-compose up -d
[ harbor]# yum install -y nginx [ harbor]# vi /etc/nginx/conf.d/harbor.od.com.conf server { listen 80; server_name harbor.od.com; client_max_body_size 1000m; location / { proxy_pass http://127.0.0.1:180; } } [ harbor]# nginx -t [ harbor]# systemctl start nginx [ harbor]# systemctl enable nginx
[ ~]# vi /var/named/od.com.zone [ ~]# cat /var/named/od.com.zone $ORIGIN od.com. $TTL 600 ; 10 minutes @ IN SOA dns.od.com. dnsadmin.od.com. ( 20200606 ; serial 10800 ; refresh (3 hours) 900 ; retry (15 minutes) 604800 ; expire (1 week) 86400 ; minimum (1 day) ) NS dns.od.com. $TTL 60 ; 1 minute dns A 192.168.12.11 harbor A 192.168.12.200 [ ~]# systemctl restart named [ ~]# dig -t A harbor.od.com +short 192.168.12.200
新建一个public项目,公开
[ harbor]# docker pull nginx:1.7.9
[ harbor]# docker tag nginx:1.7.9 harbor.od.com/public/nginx:v1.7.9
[ harbor]# docker login harbor.od.com
[ harbor]# docker push harbor.od.com/public/nginx:v1.7.9
原文章已同步到语雀‘
###host字段指定授权使用该证书的etcd节点IP或子网列表,需要将etcd集群的3个节点都添加其中。cp etcd-v3.3.13-linux-amd64/etcd* /opt/k8s/bin/