安装k8s coredns

安装k8s coredns

1.coredns yaml下载地址

https://github.com/kubernetes/kubernetes/blob/e176e477195f92919724bd02f81e2b18d4477af7/cluster/addons/dns/coredns/coredns.yaml.sed

2.修改该文件的几个地方

1) 修改集群域名

data:
  Corefile: |
    .:53 {
        errors
        health
        ready
        kubernetes $DNS_DOMAIN in-addr.arpa ip6.arpa { //$DNS_DOMAIN  修改为集群的域名 ,可以从kubelet配置文件查看
            pods insecure
            fallthrough in-addr.arpa ip6.arpa
            ttl 30
        }
        prometheus :9153
        forward . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
    }

2)修改coredns 容器资源限制

      containers:
      - name: coredns
        image: k8s.gcr.io/coredns:1.6.2   //修改下载地址  coredns/coredns:1.6.2
        imagePullPolicy: IfNotPresent
        resources:
          limits:
            memory: $DNS_MEMORY_LIMIT   //修改容器使用的最大内存
          requests:
            cpu: 100m
            memory: 70Mi
        args: [ "-conf", "/etc/coredns/Corefile" ]

3) 修改集群使用的dnsip

spec:
  selector:
    k8s-app: kube-dns
  clusterIP: $DNS_SERVER_IP  //修改为集群使用的dns ip
  ports:
  - name: dns
    port: 53

转载于:https://www.cnblogs.com/paad/p/11482168.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值