Merge pull request #58828 from rajansandeep/configtranslate
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. ```
This commit is contained in:
@@ -54,7 +54,7 @@ var InitFeatureGates = FeatureList{
|
||||
StoreCertsInSecrets: {FeatureSpec: utilfeature.FeatureSpec{Default: false, PreRelease: utilfeature.Alpha}},
|
||||
// We don't want to advertise this feature gate exists in v1.9 to avoid confusion as it is not yet working
|
||||
HighAvailability: {FeatureSpec: utilfeature.FeatureSpec{Default: false, PreRelease: utilfeature.Alpha}, MinimumVersion: v190, HiddenInHelpText: true},
|
||||
CoreDNS: {FeatureSpec: utilfeature.FeatureSpec{Default: false, PreRelease: utilfeature.Alpha}, MinimumVersion: v190},
|
||||
CoreDNS: {FeatureSpec: utilfeature.FeatureSpec{Default: false, PreRelease: utilfeature.Beta}, MinimumVersion: v190},
|
||||
DynamicKubeletConfig: {FeatureSpec: utilfeature.FeatureSpec{Default: false, PreRelease: utilfeature.Alpha}, MinimumVersion: v190},
|
||||
Auditing: {FeatureSpec: utilfeature.FeatureSpec{Default: false, PreRelease: utilfeature.Alpha}},
|
||||
}
|
||||
|
@@ -18,7 +18,9 @@ go_test(
|
||||
"//cmd/kubeadm/app/util:go_default_library",
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//pkg/util/version:go_default_library",
|
||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/fake:go_default_library",
|
||||
"//vendor/k8s.io/client-go/testing:go_default_library",
|
||||
@@ -41,6 +43,7 @@ go_library(
|
||||
"//cmd/kubeadm/app/util/apiclient:go_default_library",
|
||||
"//pkg/api/legacyscheme:go_default_library",
|
||||
"//pkg/util/version:go_default_library",
|
||||
"//vendor/github.com/mholt/caddy/caddyfile:go_default_library",
|
||||
"//vendor/k8s.io/api/apps/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1:go_default_library",
|
||||
|
@@ -17,8 +17,12 @@ limitations under the License.
|
||||
package dns
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/mholt/caddy/caddyfile"
|
||||
|
||||
apps "k8s.io/api/apps/v1"
|
||||
"k8s.io/api/core/v1"
|
||||
@@ -38,7 +42,10 @@ import (
|
||||
|
||||
const (
|
||||
// KubeDNSServiceAccountName describes the name of the ServiceAccount for the kube-dns addon
|
||||
KubeDNSServiceAccountName = "kube-dns"
|
||||
KubeDNSServiceAccountName = "kube-dns"
|
||||
kubeDNSStubDomain = "stubDomains"
|
||||
kubeDNSUpstreamNameservers = "upstreamNameservers"
|
||||
kubeDNSFederation = "federations"
|
||||
)
|
||||
|
||||
// EnsureDNSAddon creates the kube-dns or CoreDNS addon
|
||||
@@ -140,10 +147,33 @@ func coreDNSAddon(cfg *kubeadmapi.MasterConfiguration, client clientset.Interfac
|
||||
return fmt.Errorf("error when parsing CoreDNS deployment template: %v", err)
|
||||
}
|
||||
|
||||
// Get the kube-dns ConfigMap for translation to equivalent CoreDNS Config.
|
||||
kubeDNSConfigMap, err := client.CoreV1().ConfigMaps(metav1.NamespaceSystem).Get(kubeadmconstants.KubeDNS, metav1.GetOptions{})
|
||||
if err != nil && !apierrors.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
stubDomain, err := translateStubDomainOfKubeDNSToProxyCoreDNS(kubeDNSStubDomain, kubeDNSConfigMap)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
upstreamNameserver, err := translateUpstreamNameServerOfKubeDNSToUpstreamProxyCoreDNS(kubeDNSUpstreamNameservers, kubeDNSConfigMap)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
coreDNSDomain := cfg.Networking.DNSDomain
|
||||
federations, err := translateFederationsofKubeDNSToCoreDNS(kubeDNSFederation, coreDNSDomain, kubeDNSConfigMap)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Get the config file for CoreDNS
|
||||
coreDNSConfigMapBytes, err := kubeadmutil.ParseTemplate(CoreDNSConfigMap, struct{ DNSDomain, ServiceCIDR string }{
|
||||
ServiceCIDR: cfg.Networking.ServiceSubnet,
|
||||
DNSDomain: cfg.Networking.DNSDomain,
|
||||
coreDNSConfigMapBytes, err := kubeadmutil.ParseTemplate(CoreDNSConfigMap, struct{ DNSDomain, UpstreamNameserver, Federation, StubDomain string }{
|
||||
DNSDomain: coreDNSDomain,
|
||||
UpstreamNameserver: upstreamNameserver,
|
||||
Federation: federations,
|
||||
StubDomain: stubDomain,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("error when parsing CoreDNS configMap template: %v", err)
|
||||
@@ -244,3 +274,105 @@ func createDNSService(dnsService *v1.Service, serviceBytes []byte, client client
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// translateStubDomainOfKubeDNSToProxyCoreDNS 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) {
|
||||
if proxy, ok := kubeDNSConfigMap.Data[dataField]; ok {
|
||||
stubDomainData := make(map[string][]string)
|
||||
err := json.Unmarshal([]byte(proxy), &stubDomainData)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to parse JSON from 'kube-dns ConfigMap: %v", err)
|
||||
}
|
||||
|
||||
var proxyStanza []interface{}
|
||||
for domain, proxyIP := range stubDomainData {
|
||||
pStanza := map[string]interface{}{}
|
||||
pStanza["keys"] = []string{domain + ":53"}
|
||||
pStanza["body"] = [][]string{
|
||||
{"errors"},
|
||||
{"cache", "30"},
|
||||
append([]string{"proxy", "."}, proxyIP...),
|
||||
}
|
||||
proxyStanza = append(proxyStanza, pStanza)
|
||||
}
|
||||
stanzasBytes, err := json.Marshal(proxyStanza)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
corefileStanza, err := caddyfile.FromJSON(stanzasBytes)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return prepCorefileFormat(string(corefileStanza), 4), nil
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// translateUpstreamNameServerOfKubeDNSToUpstreamProxyCoreDNS translates UpstreamNameServer Data in kube-dns ConfigMap
|
||||
// in the form of Proxy for the CoreDNS Corefile.
|
||||
func translateUpstreamNameServerOfKubeDNSToUpstreamProxyCoreDNS(dataField string, kubeDNSConfigMap *v1.ConfigMap) (string, error) {
|
||||
if upstreamValues, ok := kubeDNSConfigMap.Data[dataField]; ok {
|
||||
var upstreamProxyIP []string
|
||||
|
||||
err := json.Unmarshal([]byte(upstreamValues), &upstreamProxyIP)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to parse JSON from 'kube-dns ConfigMap: %v", err)
|
||||
}
|
||||
|
||||
coreDNSProxyStanzaList := strings.Join(upstreamProxyIP, " ")
|
||||
return coreDNSProxyStanzaList, nil
|
||||
}
|
||||
return "/etc/resolv.conf", nil
|
||||
}
|
||||
|
||||
// translateFederationsofKubeDNSToCoreDNS translates Federations Data in kube-dns ConfigMap
|
||||
// to Federation for CoreDNS Corefile.
|
||||
func translateFederationsofKubeDNSToCoreDNS(dataField, coreDNSDomain string, kubeDNSConfigMap *v1.ConfigMap) (string, error) {
|
||||
if federation, ok := kubeDNSConfigMap.Data[dataField]; ok {
|
||||
var (
|
||||
federationStanza []interface{}
|
||||
body [][]string
|
||||
)
|
||||
federationData := make(map[string]string)
|
||||
|
||||
err := json.Unmarshal([]byte(federation), &federationData)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to parse JSON from kube-dns ConfigMap: %v", err)
|
||||
}
|
||||
fStanza := map[string]interface{}{}
|
||||
|
||||
for name, domain := range federationData {
|
||||
body = append(body, []string{name, domain})
|
||||
}
|
||||
federationStanza = append(federationStanza, fStanza)
|
||||
fStanza["keys"] = []string{"federation " + coreDNSDomain}
|
||||
fStanza["body"] = body
|
||||
stanzasBytes, err := json.Marshal(federationStanza)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
corefileStanza, err := caddyfile.FromJSON(stanzasBytes)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return prepCorefileFormat(string(corefileStanza), 8), nil
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// prepCorefileFormat indents the output of the Corefile caddytext and replaces tabs with spaces
|
||||
// to neatly format the configmap, making it readable.
|
||||
func prepCorefileFormat(s string, indentation int) string {
|
||||
r := []string{}
|
||||
for _, line := range strings.Split(s, "\n") {
|
||||
indented := strings.Repeat(" ", indentation) + line
|
||||
r = append(r, indented)
|
||||
}
|
||||
corefile := strings.Join(r, "\n")
|
||||
return "\n" + strings.Replace(corefile, "\t", " ", -1)
|
||||
}
|
||||
|
@@ -17,9 +17,12 @@ limitations under the License.
|
||||
package dns
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
clientsetfake "k8s.io/client-go/kubernetes/fake"
|
||||
core "k8s.io/client-go/testing"
|
||||
@@ -127,9 +130,11 @@ func TestCompileManifests(t *testing.T) {
|
||||
},
|
||||
{
|
||||
manifest: CoreDNSConfigMap,
|
||||
data: struct{ DNSDomain, ServiceCIDR string }{
|
||||
DNSDomain: "foo",
|
||||
ServiceCIDR: "foo",
|
||||
data: struct{ DNSDomain, Federation, UpstreamNameserver, StubDomain string }{
|
||||
DNSDomain: "foo",
|
||||
Federation: "foo",
|
||||
UpstreamNameserver: "foo",
|
||||
StubDomain: "foo",
|
||||
},
|
||||
expected: true,
|
||||
},
|
||||
@@ -175,3 +180,238 @@ func TestGetDNSIP(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestTranslateStubDomainKubeDNSToCoreDNS(t *testing.T) {
|
||||
testCases := []struct {
|
||||
configMap *v1.ConfigMap
|
||||
expectOne string
|
||||
expectTwo string
|
||||
}{
|
||||
{
|
||||
configMap: &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "kube-dns",
|
||||
Namespace: "kube-system",
|
||||
},
|
||||
Data: map[string]string{
|
||||
"stubDomains": `{"foo.com" : ["1.2.3.4:5300","3.3.3.3"], "my.cluster.local" : ["2.3.4.5"]}`,
|
||||
"upstreamNameservers": `["8.8.8.8", "8.8.4.4"]`,
|
||||
},
|
||||
},
|
||||
|
||||
expectOne: `
|
||||
foo.com:53 {
|
||||
errors
|
||||
cache 30
|
||||
proxy . 1.2.3.4:5300 3.3.3.3
|
||||
}
|
||||
|
||||
my.cluster.local:53 {
|
||||
errors
|
||||
cache 30
|
||||
proxy . 2.3.4.5
|
||||
}`,
|
||||
expectTwo: `
|
||||
my.cluster.local:53 {
|
||||
errors
|
||||
cache 30
|
||||
proxy . 2.3.4.5
|
||||
}
|
||||
|
||||
foo.com:53 {
|
||||
errors
|
||||
cache 30
|
||||
proxy . 1.2.3.4:5300 3.3.3.3
|
||||
}`,
|
||||
},
|
||||
{
|
||||
configMap: &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "kubedns",
|
||||
Namespace: "kube-system",
|
||||
},
|
||||
},
|
||||
|
||||
expectOne: "",
|
||||
},
|
||||
{
|
||||
configMap: &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "kube-dns",
|
||||
Namespace: "kube-system",
|
||||
},
|
||||
Data: map[string]string{
|
||||
"stubDomains": `{"foo.com" : ["1.2.3.4:5300"], "my.cluster.local" : ["2.3.4.5"]}`,
|
||||
"upstreamNameservers": `["8.8.8.8", "8.8.4.4"]`,
|
||||
},
|
||||
},
|
||||
|
||||
expectOne: `
|
||||
foo.com:53 {
|
||||
errors
|
||||
cache 30
|
||||
proxy . 1.2.3.4:5300
|
||||
}
|
||||
|
||||
my.cluster.local:53 {
|
||||
errors
|
||||
cache 30
|
||||
proxy . 2.3.4.5
|
||||
}`,
|
||||
expectTwo: `
|
||||
my.cluster.local:53 {
|
||||
errors
|
||||
cache 30
|
||||
proxy . 2.3.4.5
|
||||
}
|
||||
|
||||
foo.com:53 {
|
||||
errors
|
||||
cache 30
|
||||
proxy . 1.2.3.4:5300
|
||||
}`,
|
||||
},
|
||||
{
|
||||
configMap: &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "kube-dns",
|
||||
Namespace: "kube-system",
|
||||
},
|
||||
Data: map[string]string{
|
||||
"upstreamNameservers": `["8.8.8.8", "8.8.4.4"]`,
|
||||
},
|
||||
},
|
||||
|
||||
expectOne: "",
|
||||
},
|
||||
}
|
||||
for _, testCase := range testCases {
|
||||
out, err := translateStubDomainOfKubeDNSToProxyCoreDNS(kubeDNSStubDomain, testCase.configMap)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
if !strings.Contains(out, testCase.expectOne) && !strings.Contains(out, testCase.expectTwo) {
|
||||
t.Errorf("expected to find %q or %q in output: %q", testCase.expectOne, testCase.expectTwo, out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestTranslateUpstreamKubeDNSToCoreDNS(t *testing.T) {
|
||||
testCases := []struct {
|
||||
configMap *v1.ConfigMap
|
||||
expect string
|
||||
}{
|
||||
{
|
||||
configMap: &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "kube-dns",
|
||||
Namespace: "kube-system",
|
||||
},
|
||||
},
|
||||
|
||||
expect: "/etc/resolv.conf",
|
||||
},
|
||||
{
|
||||
configMap: &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "kubedns",
|
||||
Namespace: "kube-system",
|
||||
},
|
||||
Data: map[string]string{
|
||||
"stubDomains": ` {"foo.com" : ["1.2.3.4:5300"], "my.cluster.local" : ["2.3.4.5"]}`,
|
||||
"upstreamNameservers": `["8.8.8.8", "8.8.4.4", "4.4.4.4"]`,
|
||||
},
|
||||
},
|
||||
|
||||
expect: "8.8.8.8 8.8.4.4 4.4.4.4",
|
||||
},
|
||||
{
|
||||
configMap: &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "kubedns",
|
||||
Namespace: "kube-system",
|
||||
},
|
||||
Data: map[string]string{
|
||||
"upstreamNameservers": `["8.8.8.8", "8.8.4.4"]`,
|
||||
},
|
||||
},
|
||||
|
||||
expect: "8.8.8.8 8.8.4.4",
|
||||
},
|
||||
}
|
||||
for _, testCase := range testCases {
|
||||
out, err := translateUpstreamNameServerOfKubeDNSToUpstreamProxyCoreDNS(kubeDNSUpstreamNameservers, testCase.configMap)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
if !strings.Contains(out, testCase.expect) {
|
||||
t.Errorf("expected to find %q in output: %q", testCase.expect, out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestTranslateFederationKubeDNSToCoreDNS(t *testing.T) {
|
||||
testCases := []struct {
|
||||
configMap *v1.ConfigMap
|
||||
expectOne string
|
||||
expectTwo string
|
||||
}{
|
||||
{
|
||||
configMap: &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "kube-dns",
|
||||
Namespace: "kube-system",
|
||||
},
|
||||
Data: map[string]string{
|
||||
"federations": `{"foo" : "foo.feddomain.com", "bar" : "bar.feddomain.com"}`,
|
||||
"stubDomains": `{"foo.com" : ["1.2.3.4:5300","3.3.3.3"], "my.cluster.local" : ["2.3.4.5"]}`,
|
||||
"upstreamNameservers": `["8.8.8.8", "8.8.4.4"]`,
|
||||
},
|
||||
},
|
||||
|
||||
expectOne: `
|
||||
federation cluster.local {
|
||||
foo foo.feddomain.com
|
||||
bar bar.feddomain.com
|
||||
}`,
|
||||
expectTwo: `
|
||||
federation cluster.local {
|
||||
bar bar.feddomain.com
|
||||
foo foo.feddomain.com
|
||||
}`,
|
||||
},
|
||||
{
|
||||
configMap: &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "kubedns",
|
||||
Namespace: "kube-system",
|
||||
},
|
||||
},
|
||||
|
||||
expectOne: "",
|
||||
},
|
||||
{
|
||||
configMap: &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "kube-dns",
|
||||
Namespace: "kube-system",
|
||||
},
|
||||
Data: map[string]string{
|
||||
"stubDomains": `{"foo.com" : ["1.2.3.4:5300"], "my.cluster.local" : ["2.3.4.5"]}`,
|
||||
"upstreamNameservers": `["8.8.8.8", "8.8.4.4"]`,
|
||||
},
|
||||
},
|
||||
|
||||
expectOne: "",
|
||||
},
|
||||
}
|
||||
for _, testCase := range testCases {
|
||||
out, err := translateFederationsofKubeDNSToCoreDNS(kubeDNSFederation, "cluster.local", testCase.configMap)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
if !strings.Contains(out, testCase.expectOne) && !strings.Contains(out, testCase.expectTwo) {
|
||||
t.Errorf("expected to find %q or %q in output: %q", testCase.expectOne, testCase.expectTwo, out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -307,15 +307,15 @@ data:
|
||||
.:53 {
|
||||
errors
|
||||
health
|
||||
kubernetes {{ .DNSDomain }} {{ .ServiceCIDR }} {
|
||||
kubernetes {{ .DNSDomain }} in-addr.arpa ip6.arpa {
|
||||
pods insecure
|
||||
upstream /etc/resolv.conf
|
||||
upstream
|
||||
fallthrough in-addr.arpa ip6.arpa
|
||||
}
|
||||
}{{ .Federation }}
|
||||
prometheus :9153
|
||||
proxy . /etc/resolv.conf
|
||||
proxy . {{ .UpstreamNameserver }}
|
||||
cache 30
|
||||
}
|
||||
}{{ .StubDomain }}
|
||||
`
|
||||
// CoreDNSClusterRole is the CoreDNS ClusterRole manifest
|
||||
CoreDNSClusterRole = `
|
||||
|
@@ -23,13 +23,13 @@ import (
|
||||
|
||||
const (
|
||||
kubeDNSv190AndAboveVersion = "1.14.8"
|
||||
coreDNSVersion = "1.0.4"
|
||||
coreDNSVersion = "1.0.6"
|
||||
)
|
||||
|
||||
// GetDNSVersion returns the right kube-dns version for a specific k8s version
|
||||
func GetDNSVersion(kubeVersion *version.Version, dns string) string {
|
||||
// v1.9.0+ uses kube-dns 1.14.8
|
||||
// v1.9.0+ uses CoreDNS 1.0.4 if feature gate "CoreDNS" is enabled.
|
||||
// v1.9.0+ uses CoreDNS 1.0.6 if feature gate "CoreDNS" is enabled.
|
||||
|
||||
// In the future when the version is bumped at HEAD; add conditional logic to return the right versions
|
||||
// Also, the version might be bumped for different k8s releases on the same branch
|
||||
|
Reference in New Issue
Block a user