K8S-安装部署服务发现插件-coredns

一、CoreDNS的作用

CoreDNS用于实现 service --> cluster IP 的DNS解析。以容器的方式交付到k8s集群,由k8s自行管理,降低人为操作的复杂度。

二、配置nginx

在运维主机172.16.1.55上,配置一个nginx虚拟机,用以提供k8s统一资源配置清单访问入口。

[root@hdss1-55 ~]# cd /etc/nginx/conf.d/
[root@hdss1-55 conf.d]# vim k8s-yaml.od.com.conf
[root@hdss1-55 conf.d]# mkdir -p /data/k8s-yaml
[root@hdss1-55 conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@hdss1-55 conf.d]# nginx -s reload

三、DNS服务器回滚

172.16.1.51上操作

[root@hdss1-51 ~]# vim /var/named/od.com.zone 
$ORIGIN od.com.
$TTL 600  ; 10 minutes
@       IN SOA  dns.od.com. dnsadmin.od.com. (
        **2020101903** ; 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    172.16.1.51
harbor             A    172.16.1.55
**k8s-yaml           A    172.16.1.55**                              
[root@hdss1-51 ~]# systemctl restart named
[root@hdss1-51 ~]# dig -t A k8s-yaml.od.com @172.16.1.51 +short
172.16.1.55

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值