zoukankan      html  css  js  c++  java
  • k8s修改集群coredns

    修改coredns 新增加dns 内容
    $ kubectl get cm coredns  -n kube-system   -o yaml
    apiVersion: v1
    data:
      Corefile: |
        .:53 {
            errors
            health
            hosts /etc/coredns/Hosts {
              fallthrough
            }
            kubernetes cluster.local in-addr.arpa ip6.arpa {
               pods insecure
               upstream
               fallthrough in-addr.arpa ip6.arpa
            }
            prometheus :9153
            forward . /etc/resolv.conf
            cache 30
            loop
            reload
            loadbalance
        }
      Hosts: |
        172.24.119.223 news-graphql.xy.huijitrans.com
        172.24.119.223 tgbus-live.xy.huijitrans.com
        172.24.119.223 tgbus-comment.xy.huijitrans.com
        172.24.119.223 tgbus-user.xy.huijitrans.com
        172.24.119.223 graphql.xy.huijitrans.com
        172.24.119.223 tgbus-api.xy.huijitrans.com
        172.24.119.101 k8s-master01.gdfsxxds.rjyun  master01
        172.24.119.102 k8s-master02.gdfsxxds.rjyun  master02
        172.24.119.103 k8s-master03.gdfsxxds.rjyun  master03
        172.24.119.223 k8s-node01.gdfsxxds.rjyun    node01
        172.24.119.224 k8s-node02.gdfsxxds.rjyun    node02
        172.24.119.225 k8s-node03.gdfsxxds.rjyun    node03
        172.24.119.226 k8s-node04.gdfsxxds.rjyun    node04
        172.24.119.252 k8s-harbor01 k8s-harbor01.gdfsxxds.rjyun
        192.168.8.11 mysql-178-fs189
    kind: ConfigMap
    metadata:
      creationTimestamp: "2019-08-20T04:48:50Z"
      name: coredns
      namespace: kube-system
      resourceVersion: "56953316"
      selfLink: /api/v1/namespaces/kube-system/configmaps/coredns
      uid: cd9f9802-c305-11e9-8099-b8ca3a60e5c8
    
    
    2. 修改 deployment coredns
    
    
     kubectl edit  deployment  coredns  -n kube-system   
          volumes:
          - configMap:
              defaultMode: 420
              items:
              - key: Corefile
                path: Corefile
              - key: Hosts    新增加 hosts 配置内容
                path: Hosts
              name: coredns
            name: config-volume
    
    
    
    
    
    
    3. coredns pod 会自动重新部署
    $ kubectl get pod -n kube-system  |grep dns
    coredns-c7b458cf-spkv7                                1/1     Running   0          6m15s
    coredns-c7b458cf-wpjjq                                1/1     Running   0          6m15s
    

      

  • 相关阅读:
    rest framework 认证 权限 频率
    rest framework 视图,路由
    rest framework 序列化
    10.3 Vue 路由系统
    10.4 Vue 父子传值
    10.2 Vue 环境安装
    10.1 ES6 的新增特性以及简单语法
    Django 跨域请求处理
    20190827 On Java8 第十四章 流式编程
    20190825 On Java8 第十三章 函数式编程
  • 原文地址:https://www.cnblogs.com/lixinliang/p/12217319.html
Copyright © 2011-2022 走看看