k8s 之harbor仓库安装(四)
1.200机器安装harbor仓库
[ ~]# 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
2.安装nginx做反向代理
[ 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
3 dns服务器配置域名
[ ~]# 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
原文章已同步到语雀‘
相关推荐
tosim 2020-06-24
88427810 2020-11-02
kunyus 2020-10-28
hubanbei00的家园 2020-10-25
btqszl 2020-10-21
XiaoMuFireAnt 2020-09-02
shurenyun 2020-08-19
CurrentJ 2020-08-18
hegaoye0 2020-08-18
WFMoonlight 2020-08-17
xiunai 2020-08-02
技术积累LZ 2020-07-28
lilygg 2020-07-22
akcsdno 2020-07-21
winc 2020-07-05
Dannyvon 2020-07-04
###host字段指定授权使用该证书的etcd节点IP或子网列表,需要将etcd集群的3个节点都添加其中。cp etcd-v3.3.13-linux-amd64/etcd* /opt/k8s/bin/
xiunai 2020-07-04
hevenue 2020-06-28