[root@dns ~]# cat -n /etc/named.conf 1 // 2 // named.conf 3 // 4 // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS 5 // server as a caching only nameserver (as a localhost DNS resolver only). 6 // 7 // See /usr/share/doc/bind*/sample/ for example named configuration files. 8 // 9 // See the BIND Administrator's Reference Manual (ARM) for details about the 10 // configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html 11 12 options { 13 listen-on port 53 { 127.0.0.1;any; }; 14 listen-on-v6 port 53 { ::1; }; 15 directory "/var/named"; 16 dump-file "/var/named/data/cache_dump.db"; 17 statistics-file "/var/named/data/named_stats.txt"; 18 memstatistics-file "/var/named/data/named_mem_stats.txt"; 19 recursing-file "/var/named/data/named.recursing"; 20 secroots-file "/var/named/data/named.secroots"; 21 allow-query { localhost;any; }; 22 23 /* 24 - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion. 25 - If you are building a RECURSIVE (caching) DNS server, you need to enable 26 recursion. 27 - If your recursive DNS server has a public IP address, you MUST enable access 28 control to limit queries to your legitimate users. Failing to do so will 29 cause your server to become part of large scale DNS amplification 30 attacks. Implementing BCP38 within your network would greatly 31 reduce such attack surface 32 */ 33 recursion yes; 34 35 dnssec-enable yes; 36 dnssec-validation yes; 37 38 /* Path to ISC DLV key */ 39 bindkeys-file "/etc/named.root.key"; 40 41 managed-keys-directory "/var/named/dynamic"; 42 43 pid-file "/run/named/named.pid"; 44 session-keyfile "/run/named/session.key"; 45 }; 46 47 logging { 48 channel default_debug { 49 file "data/named.run"; 50 severity dynamic; 51 }; 52 }; 53 54 zone "." IN { 55 type hint; 56 file "named.ca"; 57 }; 58 59 include "/etc/named.rfc1912.zones"; 60 include "/etc/named.root.key";
[root@nginx ~]# cd soft/ [root@nginxsoft]# ls echo-nginx-module-0.61.tar.gz nginx-1.18.0.tar.gz ngx-fancyindex-0.4.3.tar.gz [root@nginxsoft]# tar xf ngx-fancyindex-0.4.3.tar.gz [root@nginxsoft]# tar xf nginx-1.18.0.tar.gz [root@nginxsoft]# tar xf echo-nginx-module-0.61.tar.gz [root@nginxsoft]# ls echo-nginx-module-0.61 nginx-1.18.0 ngx-fancyindex-0.4.3 echo-nginx-module-0.61.tar.gz nginx-1.18.0.tar.gz ngx-fancyindex-0.4.3.tar.gz
[root@nginx ~]# cat /etc/rc.d/rc.local #!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to create own systemd services or udev rules # to run scripts during boot instead of using this file. # # In contrast to previous versions due to parallel execution during boot # this script will NOT be run after all other services. # # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure # that this script will be executed during boot.
# 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: www.kubels.com 修改为域名,而且一定是证书签发的域名
# 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: /root/harbor/6864844_kubels.com.pem 证书 如果没有证书要注释掉https的这段配置 private_key: /root/harbor/6864844_kubels.com.key 密钥
# # Uncomment following will enable tls communication between all harbor components # internal_tls: # # set enabled to true means internal tls is enabled # enabled: true # # put your cert and key files on dir # dir: /etc/harbor/tls/internal
# Uncomment external_url if you want to enable external proxy # And when it enabled the hostname will no longer used # external_url: https://reg.mydomain.com:8433
# The initial password of Harbor admin # It only works in first time to install harbor # Remember Change the admin password from UI after launching Harbor. harbor_admin_password: 12345 访问密码 ......
执行预备脚本
1 2 3 4
prepare base dir is set to /home/harbor Unable to find image 'goharbor/prepare:v2.6.0' locally docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 192.168.31.211:53: server misbehaving. See 'docker run --help'.
[Step4]: preparing harbor configs ... prepare base dir is set to /root/harbor
[Step5]: starting Harbor ... Creating network "harbor_harbor" with the default driver Creating harbor-log ... done Creating harbor-db ... done Creating registry ... done Creating registryctl ... done Creating redis ... done Creating harbor-portal ... done Creating harbor-core ... done Creating harbor-jobservice ... done Creating nginx ... done ✔ ----Harbor has been installed and started successfully.----
验证运行情况
9个镜像在运行,少一个都不行
1 2 3 4 5 6 7 8 9 10 11 12
# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 71c0db683e4a goharbor/nginx-photon:v2.4.1"nginx -g 'daemon of…" About a minute ago Up About a minute (healthy) 0.0.0.0:80->8080/tcp, :::80->8080/tcp, 0.0.0.0:443->8443/tcp, :::443->8443/tcp nginx 4e3b53a86f01 goharbor/harbor-jobservice:v2.4.1"/harbor/entrypoint.…" About a minute ago Up About a minute (healthy) harbor-jobservice df76e1eabbf7 goharbor/harbor-core:v2.4.1"/harbor/entrypoint.…" About a minute ago Up About a minute (healthy) harbor-core eeb4d224dfc4 goharbor/harbor-portal:v2.4.1"nginx -g 'daemon of…" About a minute ago Up About a minute (healthy) harbor-portal 70e162c38b59 goharbor/redis-photon:v2.4.1"redis-server /etc/r…" About a minute ago Up About a minute (healthy) redis 8bcc0e9b06ec goharbor/harbor-registryctl:v2.4.1"/home/harbor/start.…" About a minute ago Up About a minute (healthy) registryctl d88196398df7 goharbor/registry-photon:v2.4.1"/home/harbor/entryp…" About a minute ago Up About a minute (healthy) registry ed5ba2ba9c82 goharbor/harbor-db:v2.4.1"/docker-entrypoint.…" About a minute ago Up About a minute (healthy) harbor-db dcb4b57c7542 goharbor/harbor-log:v2.4.1"/bin/sh -c /usr/loc…" About a minute ago Up About a minute (healthy) 127.0.0.1:1514->10514/tcp harbor-log
[root@harbor ~]# docker login www.kubels.com Username: admin Password: 12345 WARNING! Your password will be stored unencrypted in /root/.docker/config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store
[root@k8s-* ~]# docker login www.kubels.com Username: admin Password: 12345 WARNING! Your password will be stored unencrypted in /root/.docker/config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store
[root@nfs ~]# systemctl enable nfs-server;systemctl start nfs-server Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service. [root@nfs ~]# systemctl status nfs-server
1 2 3
[root@nfs ~]# showmount -e Export list for nfs: /sdb *
1 2 3 4 5
为了模拟在k8s集群主机中验证nfs可用性 [root@k8s-master01 ~]# yum -y install nfs-utils [root@k8s-master01 ~]# showmount -e nfs.kubels.com Export list for nfs.kubels.com: /sdb *