Merge pull request #73267 from rajansandeep/proxytoforward

Use forward plugin instead of proxy plugin in the default configuration of CoreDNS
pull/564/head
Kubernetes Prow Robot 2019-01-29 11:32:28 -08:00 committed by GitHub
commit c501d464af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 17 deletions

View File

@ -70,7 +70,7 @@ data:
fallthrough in-addr.arpa ip6.arpa fallthrough in-addr.arpa ip6.arpa
} }
prometheus :9153 prometheus :9153
proxy . /etc/resolv.conf forward . /etc/resolv.conf
cache 30 cache 30
loop loop
reload reload

View File

@ -70,7 +70,7 @@ data:
fallthrough in-addr.arpa ip6.arpa fallthrough in-addr.arpa ip6.arpa
} }
prometheus :9153 prometheus :9153
proxy . /etc/resolv.conf forward . /etc/resolv.conf
cache 30 cache 30
loop loop
reload reload

View File

@ -70,7 +70,7 @@ data:
fallthrough in-addr.arpa ip6.arpa fallthrough in-addr.arpa ip6.arpa
} }
prometheus :9153 prometheus :9153
proxy . /etc/resolv.conf forward . /etc/resolv.conf
cache 30 cache 30
loop loop
reload reload

View File

@ -172,7 +172,7 @@ func coreDNSAddon(cfg *kubeadmapi.InitConfiguration, client clientset.Interface)
return err return err
} }
stubDomain, err := translateStubDomainOfKubeDNSToProxyCoreDNS(kubeDNSStubDomain, kubeDNSConfigMap) stubDomain, err := translateStubDomainOfKubeDNSToForwardCoreDNS(kubeDNSStubDomain, kubeDNSConfigMap)
if err != nil { if err != nil {
return err return err
} }
@ -294,9 +294,9 @@ func createDNSService(dnsService *v1.Service, serviceBytes []byte, client client
return nil return nil
} }
// translateStubDomainOfKubeDNSToProxyCoreDNS translates StubDomain Data in kube-dns ConfigMap // translateStubDomainOfKubeDNSToForwardCoreDNS translates StubDomain Data in kube-dns ConfigMap
// in the form of Proxy for the CoreDNS Corefile. // in the form of Proxy for the CoreDNS Corefile.
func translateStubDomainOfKubeDNSToProxyCoreDNS(dataField string, kubeDNSConfigMap *v1.ConfigMap) (string, error) { func translateStubDomainOfKubeDNSToForwardCoreDNS(dataField string, kubeDNSConfigMap *v1.ConfigMap) (string, error) {
if kubeDNSConfigMap == nil { if kubeDNSConfigMap == nil {
return "", nil return "", nil
} }
@ -316,7 +316,7 @@ func translateStubDomainOfKubeDNSToProxyCoreDNS(dataField string, kubeDNSConfigM
{"errors"}, {"errors"},
{"cache", "30"}, {"cache", "30"},
{"loop"}, {"loop"},
append([]string{"proxy", "."}, proxyIP...), append([]string{"forward", "."}, proxyIP...),
} }
proxyStanza = append(proxyStanza, pStanza) proxyStanza = append(proxyStanza, pStanza)
} }

View File

@ -206,28 +206,28 @@ func TestTranslateStubDomainKubeDNSToCoreDNS(t *testing.T) {
errors errors
cache 30 cache 30
loop loop
proxy . 1.2.3.4:5300 3.3.3.3 forward . 1.2.3.4:5300 3.3.3.3
} }
my.cluster.local:53 { my.cluster.local:53 {
errors errors
cache 30 cache 30
loop loop
proxy . 2.3.4.5 forward . 2.3.4.5
}`, }`,
expectTwo: ` expectTwo: `
my.cluster.local:53 { my.cluster.local:53 {
errors errors
cache 30 cache 30
loop loop
proxy . 2.3.4.5 forward . 2.3.4.5
} }
foo.com:53 { foo.com:53 {
errors errors
cache 30 cache 30
loop loop
proxy . 1.2.3.4:5300 3.3.3.3 forward . 1.2.3.4:5300 3.3.3.3
}`, }`,
}, },
{ {
@ -257,28 +257,28 @@ func TestTranslateStubDomainKubeDNSToCoreDNS(t *testing.T) {
errors errors
cache 30 cache 30
loop loop
proxy . 1.2.3.4:5300 forward . 1.2.3.4:5300
} }
my.cluster.local:53 { my.cluster.local:53 {
errors errors
cache 30 cache 30
loop loop
proxy . 2.3.4.5 forward . 2.3.4.5
}`, }`,
expectTwo: ` expectTwo: `
my.cluster.local:53 { my.cluster.local:53 {
errors errors
cache 30 cache 30
loop loop
proxy . 2.3.4.5 forward . 2.3.4.5
} }
foo.com:53 { foo.com:53 {
errors errors
cache 30 cache 30
loop loop
proxy . 1.2.3.4:5300 forward . 1.2.3.4:5300
}`, }`,
}, },
{ {
@ -296,7 +296,7 @@ func TestTranslateStubDomainKubeDNSToCoreDNS(t *testing.T) {
}, },
} }
for _, testCase := range testCases { for _, testCase := range testCases {
out, err := translateStubDomainOfKubeDNSToProxyCoreDNS(kubeDNSStubDomain, testCase.configMap) out, err := translateStubDomainOfKubeDNSToForwardCoreDNS(kubeDNSStubDomain, testCase.configMap)
if err != nil { if err != nil {
t.Errorf("unexpected error: %v", err) t.Errorf("unexpected error: %v", err)
} }

View File

@ -313,7 +313,7 @@ data:
fallthrough in-addr.arpa ip6.arpa fallthrough in-addr.arpa ip6.arpa
}{{ .Federation }} }{{ .Federation }}
prometheus :9153 prometheus :9153
proxy . {{ .UpstreamNameserver }} forward . {{ .UpstreamNameserver }}
cache 30 cache 30
loop loop
reload reload