• Kubernetes Submit Queue's avatar
    Merge pull request #58828 from rajansandeep/configtranslate · c444954d
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
    
    Kube-dns configmap translation to CoreDNS
    
    **What this PR does / why we need it**:
    Translation of kube-dns ConfigMap (StubDomains and UpstreamNameserver) to equivalent Proxy in CoreDNS.
    
    **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
    Fixes kubernetes/kubeadm#662
    
    **Special notes for your reviewer**:
    
    Currently, the translation is done as follows:
    Example ConfigMap of kube-dns.
    ```
    apiVersion: v1
    data:
      federations: |
        {"foo" : "foo.feddomain.com"}
      stubDomains: |
        {"abc.com" : ["1.2.3.4"], "my.cluster.local" : ["2.3.4.5"]}
      upstreamNameservers: |
        ["8.8.8.8", "8.8.4.4"]
    kind: ConfigMap
    metadata:
      creationTimestamp: 2018-01-22T20:21:56Z
      name: kube-dns
      namespace: kube-system
    ```
    
    CoreDNS Corefile after translation.
    
    ```
       .:53 {
            errors
            health
            kubernetes cluster.local  in-addr.arpa ip6.arpa {
               upstream  8.8.8.8 8.8.4.4
               pods insecure
               fallthrough in-addr.arpa ip6.arpa
            }
           federation cluster.local {
               foo foo.feddomain.com
            }
            prometheus :9153
            proxy .  8.8.8.8 8.8.4.4
            cache 30
        }
        abc.com:53 {
            errors
            cache 30
            proxy . 1.2.3.4
        }
        my.cluster.local:53 {
            errors
            cache 30
            proxy . 2.3.4.5
        }
    ```
    
    
    
    **Release note**:
    
    ```release-note
    Kubeadm: CoreDNS supports migration of the kube-dns configuration to CoreDNS configuration when upgrading the service discovery from kube-dns to CoreDNS as part of Beta. 
    ```
    c444954d
BUILD 2.26 KB