Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c501d464
Unverified
Commit
c501d464
authored
Jan 29, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Jan 29, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #73267 from rajansandeep/proxytoforward
Use forward plugin instead of proxy plugin in the default configuration of CoreDNS
parents
cbf52183
c346ae1e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
17 deletions
+17
-17
coredns.yaml.base
cluster/addons/dns/coredns/coredns.yaml.base
+1
-1
coredns.yaml.in
cluster/addons/dns/coredns/coredns.yaml.in
+1
-1
coredns.yaml.sed
cluster/addons/dns/coredns/coredns.yaml.sed
+1
-1
dns.go
cmd/kubeadm/app/phases/addons/dns/dns.go
+4
-4
dns_test.go
cmd/kubeadm/app/phases/addons/dns/dns_test.go
+9
-9
manifests.go
cmd/kubeadm/app/phases/addons/dns/manifests.go
+1
-1
No files found.
cluster/addons/dns/coredns/coredns.yaml.base
View file @
c501d464
...
@@ -70,7 +70,7 @@ data:
...
@@ -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
...
...
cluster/addons/dns/coredns/coredns.yaml.in
View file @
c501d464
...
@@ -70,7 +70,7 @@ data:
...
@@ -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
...
...
cluster/addons/dns/coredns/coredns.yaml.sed
View file @
c501d464
...
@@ -70,7 +70,7 @@ data:
...
@@ -70,7 +70,7 @@ data:
fallthrough in-addr.arpa ip6.arpa
fallthrough in-addr.arpa ip6.arpa
}
}
prometheus :9153
prometheus :9153
prox
y
.
/et
c
/resolv.conf
forward
. /etc/resolv.conf
cache 30
cache 30
loop
loop
reload
reload
...
...
cmd/kubeadm/app/phases/addons/dns/dns.go
View file @
c501d464
...
@@ -172,7 +172,7 @@ func coreDNSAddon(cfg *kubeadmapi.InitConfiguration, client clientset.Interface)
...
@@ -172,7 +172,7 @@ func coreDNSAddon(cfg *kubeadmapi.InitConfiguration, client clientset.Interface)
return
err
return
err
}
}
stubDomain
,
err
:=
translateStubDomainOfKubeDNSTo
Proxy
CoreDNS
(
kubeDNSStubDomain
,
kubeDNSConfigMap
)
stubDomain
,
err
:=
translateStubDomainOfKubeDNSTo
Forward
CoreDNS
(
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
...
@@ -294,9 +294,9 @@ func createDNSService(dnsService *v1.Service, serviceBytes []byte, client client
return
nil
return
nil
}
}
// translateStubDomainOfKubeDNSTo
Proxy
CoreDNS translates StubDomain Data in kube-dns ConfigMap
// translateStubDomainOfKubeDNSTo
Forward
CoreDNS 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
translateStubDomainOfKubeDNSTo
Proxy
CoreDNS
(
dataField
string
,
kubeDNSConfigMap
*
v1
.
ConfigMap
)
(
string
,
error
)
{
func
translateStubDomainOfKubeDNSTo
Forward
CoreDNS
(
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
...
@@ -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
)
}
}
...
...
cmd/kubeadm/app/phases/addons/dns/dns_test.go
View file @
c501d464
...
@@ -206,28 +206,28 @@ func TestTranslateStubDomainKubeDNSToCoreDNS(t *testing.T) {
...
@@ -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) {
...
@@ -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) {
...
@@ -296,7 +296,7 @@ func TestTranslateStubDomainKubeDNSToCoreDNS(t *testing.T) {
},
},
}
}
for
_
,
testCase
:=
range
testCases
{
for
_
,
testCase
:=
range
testCases
{
out
,
err
:=
translateStubDomainOfKubeDNSTo
Proxy
CoreDNS
(
kubeDNSStubDomain
,
testCase
.
configMap
)
out
,
err
:=
translateStubDomainOfKubeDNSTo
Forward
CoreDNS
(
kubeDNSStubDomain
,
testCase
.
configMap
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"unexpected error: %v"
,
err
)
t
.
Errorf
(
"unexpected error: %v"
,
err
)
}
}
...
...
cmd/kubeadm/app/phases/addons/dns/manifests.go
View file @
c501d464
...
@@ -313,7 +313,7 @@ data:
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment