Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use forward plugin instead of proxy plugin in the default configuration of CoreDNS #73267

Merged
merged 1 commit into from Jan 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cluster/addons/dns/coredns/coredns.yaml.base
Expand Up @@ -70,7 +70,7 @@ data:
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
proxy . /etc/resolv.conf
forward . /etc/resolv.conf
cache 30
loop
reload
Expand Down
2 changes: 1 addition & 1 deletion cluster/addons/dns/coredns/coredns.yaml.in
Expand Up @@ -70,7 +70,7 @@ data:
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
proxy . /etc/resolv.conf
forward . /etc/resolv.conf
cache 30
loop
reload
Expand Down
2 changes: 1 addition & 1 deletion cluster/addons/dns/coredns/coredns.yaml.sed
Expand Up @@ -70,7 +70,7 @@ data:
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
proxy . /etc/resolv.conf
forward . /etc/resolv.conf
cache 30
loop
reload
Expand Down
8 changes: 4 additions & 4 deletions cmd/kubeadm/app/phases/addons/dns/dns.go
Expand Up @@ -172,7 +172,7 @@ func coreDNSAddon(cfg *kubeadmapi.InitConfiguration, client clientset.Interface)
return err
}

stubDomain, err := translateStubDomainOfKubeDNSToProxyCoreDNS(kubeDNSStubDomain, kubeDNSConfigMap)
stubDomain, err := translateStubDomainOfKubeDNSToForwardCoreDNS(kubeDNSStubDomain, kubeDNSConfigMap)
if err != nil {
return err
}
Expand Down Expand Up @@ -294,9 +294,9 @@ func createDNSService(dnsService *v1.Service, serviceBytes []byte, client client
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.
func translateStubDomainOfKubeDNSToProxyCoreDNS(dataField string, kubeDNSConfigMap *v1.ConfigMap) (string, error) {
func translateStubDomainOfKubeDNSToForwardCoreDNS(dataField string, kubeDNSConfigMap *v1.ConfigMap) (string, error) {
if kubeDNSConfigMap == nil {
return "", nil
}
Expand All @@ -316,7 +316,7 @@ func translateStubDomainOfKubeDNSToProxyCoreDNS(dataField string, kubeDNSConfigM
{"errors"},
{"cache", "30"},
{"loop"},
append([]string{"proxy", "."}, proxyIP...),
append([]string{"forward", "."}, proxyIP...),
}
proxyStanza = append(proxyStanza, pStanza)
}
Expand Down
18 changes: 9 additions & 9 deletions cmd/kubeadm/app/phases/addons/dns/dns_test.go
Expand Up @@ -206,28 +206,28 @@ func TestTranslateStubDomainKubeDNSToCoreDNS(t *testing.T) {
errors
cache 30
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 {
errors
cache 30
loop
proxy . 2.3.4.5
forward . 2.3.4.5
}`,
expectTwo: `
my.cluster.local:53 {
errors
cache 30
loop
proxy . 2.3.4.5
forward . 2.3.4.5
}

foo.com:53 {
errors
cache 30
loop
proxy . 1.2.3.4:5300 3.3.3.3
forward . 1.2.3.4:5300 3.3.3.3
}`,
},
{
Expand Down Expand Up @@ -257,28 +257,28 @@ func TestTranslateStubDomainKubeDNSToCoreDNS(t *testing.T) {
errors
cache 30
loop
proxy . 1.2.3.4:5300
forward . 1.2.3.4:5300
}

my.cluster.local:53 {
errors
cache 30
loop
proxy . 2.3.4.5
forward . 2.3.4.5
}`,
expectTwo: `
my.cluster.local:53 {
errors
cache 30
loop
proxy . 2.3.4.5
forward . 2.3.4.5
}

foo.com:53 {
errors
cache 30
loop
proxy . 1.2.3.4:5300
forward . 1.2.3.4:5300
}`,
},
{
Expand All @@ -296,7 +296,7 @@ func TestTranslateStubDomainKubeDNSToCoreDNS(t *testing.T) {
},
}
for _, testCase := range testCases {
out, err := translateStubDomainOfKubeDNSToProxyCoreDNS(kubeDNSStubDomain, testCase.configMap)
out, err := translateStubDomainOfKubeDNSToForwardCoreDNS(kubeDNSStubDomain, testCase.configMap)
if err != nil {
t.Errorf("unexpected error: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeadm/app/phases/addons/dns/manifests.go
Expand Up @@ -309,7 +309,7 @@ data:
fallthrough in-addr.arpa ip6.arpa
}{{ .Federation }}
prometheus :9153
proxy . {{ .UpstreamNameserver }}
forward . {{ .UpstreamNameserver }}
cache 30
loop
reload
Expand Down