From 2844abd2255fbc91df4ad17a8a5922084cc4a7f8 Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Wed, 16 Dec 2020 07:53:51 +0200 Subject: [PATCH] Delay defaulting to CoreDNS to k8s v1.20 --- docs/cluster_spec.md | 2 +- upup/pkg/fi/cloudup/bootstrapchannelbuilder.go | 4 ++-- upup/pkg/fi/cloudup/template_functions.go | 17 +++++++++++------ ...cloud-controller.addons.k8s.io-k8s-1.18.yaml | 3 +-- .../awscloudcontroller/cluster.yaml | 2 +- .../awscloudcontroller/manifest.yaml | 2 +- .../awsiamauthenticator/cluster.yaml | 2 +- .../bootstrapchannelbuilder/simple/cluster.yaml | 2 +- .../bootstrapchannelbuilder/weave/cluster.yaml | 2 +- 9 files changed, 20 insertions(+), 16 deletions(-) diff --git a/docs/cluster_spec.md b/docs/cluster_spec.md index fbbe563f21..fdd7a31591 100644 --- a/docs/cluster_spec.md +++ b/docs/cluster_spec.md @@ -610,7 +610,7 @@ Note that as of Kubernetes 1.8.0 kube-scheduler does not reload its configuratio This block contains configurations for [CoreDNS](https://coredns.io/). -For Kubernetes version >= 1.18, `CoreDNS` will be installed as the default DNS server. +For Kubernetes version >= 1.20, `CoreDNS` will be installed as the default DNS server. ```yaml spec: diff --git a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go index 836539164b..972b75b060 100644 --- a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go +++ b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go @@ -263,12 +263,12 @@ func (b *BootstrapChannelBuilder) buildAddons(c *fi.ModelBuilderContext) (*chann kubeDNS := b.Cluster.Spec.KubeDNS - // This checks if the Kubernetes version is greater than or equal to 1.19 + // This checks if the Kubernetes version is greater than or equal to 1.20 // and makes the default DNS server as CoreDNS if the DNS provider is not specified // and the Kubernetes version is >=1.19 if kubeDNS.Provider == "" { kubeDNS.Provider = "KubeDNS" - if b.Cluster.IsKubernetesGTE("1.19") { + if b.Cluster.IsKubernetesGTE("1.20") { kubeDNS.Provider = "CoreDNS" } } diff --git a/upup/pkg/fi/cloudup/template_functions.go b/upup/pkg/fi/cloudup/template_functions.go index 76b657be61..d58e187358 100644 --- a/upup/pkg/fi/cloudup/template_functions.go +++ b/upup/pkg/fi/cloudup/template_functions.go @@ -538,15 +538,20 @@ func (tf *TemplateFunctions) OpenStackCCMTag() string { func (tf *TemplateFunctions) AWSCCMTag() (string, error) { var tag string parsed, err := util.ParseKubernetesVersion(tf.Cluster.Spec.KubernetesVersion) - - // Update when we have stable releases if err != nil { return "", fmt.Errorf("failed to parse Kubernetes version from cluster spec: %q", err) - } else if parsed.Minor == 18 { - tag = "v1.18.0-alpha.1" - } else if parsed.Minor == 19 { - tag = "v1.19.0-alpha.1" } + + // Update when we have stable releases + switch parsed.Minor { + case 18: + tag = "v1.18.0-alpha.1" + case 19: + tag = "v1.19.0-alpha.1" + default: + tag = "latest" + } + return tag, nil } diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/aws-cloud-controller.addons.k8s.io-k8s-1.18.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/aws-cloud-controller.addons.k8s.io-k8s-1.18.yaml index 6d1227c4ba..72149e1dc4 100644 --- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/aws-cloud-controller.addons.k8s.io-k8s-1.18.yaml +++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/aws-cloud-controller.addons.k8s.io-k8s-1.18.yaml @@ -19,7 +19,7 @@ spec: - --v=2 - --cloud-provider=aws - --use-service-account-credentials=true - image: gcr.io/k8s-staging-provider-aws/cloud-controller-manager:v1.19.0-alpha.1 + image: gcr.io/k8s-staging-provider-aws/cloud-controller-manager:latest name: aws-cloud-controller-manager resources: requests: @@ -166,4 +166,3 @@ subjects: kind: ServiceAccount name: cloud-controller-manager namespace: kube-system - diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/cluster.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/cluster.yaml index b227540ed3..c91b70d045 100644 --- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/cluster.yaml +++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/cluster.yaml @@ -23,7 +23,7 @@ spec: cloudControllerManager: cloudProvider: aws iam: {} - kubernetesVersion: v1.19.2 + kubernetesVersion: v1.20.0 masterInternalName: api.internal.minimal.example.com masterPublicName: api.minimal.example.com additionalSans: diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/manifest.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/manifest.yaml index d62356d408..2a7d02e3ba 100644 --- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/manifest.yaml +++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awscloudcontroller/manifest.yaml @@ -64,7 +64,7 @@ spec: - id: k8s-1.18 kubernetesVersion: '>=1.18.0' manifest: aws-cloud-controller.addons.k8s.io/k8s-1.18.yaml - manifestHash: 3edf9b4350921e900c7ad6793b7a39ad4b49d0be + manifestHash: 8a158e20cd289197a1378cf6cc95d1f81a2f5278 name: aws-cloud-controller.addons.k8s.io selector: k8s-addon: aws-cloud-controller.addons.k8s.io diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awsiamauthenticator/cluster.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awsiamauthenticator/cluster.yaml index c70f2c6dfb..b09f320d26 100644 --- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awsiamauthenticator/cluster.yaml +++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/awsiamauthenticator/cluster.yaml @@ -25,7 +25,7 @@ spec: name: master-us-test-1a name: events iam: {} - kubernetesVersion: v1.19.2 + kubernetesVersion: v1.20.0 masterInternalName: api.internal.minimal.example.com masterPublicName: api.minimal.example.com additionalSans: diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/simple/cluster.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/simple/cluster.yaml index 36a0df3c89..fcbc51fa43 100644 --- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/simple/cluster.yaml +++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/simple/cluster.yaml @@ -21,7 +21,7 @@ spec: name: master-us-test-1a name: events iam: {} - kubernetesVersion: v1.19.2 + kubernetesVersion: v1.20.0 masterInternalName: api.internal.minimal.example.com masterPublicName: api.minimal.example.com additionalSans: diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/weave/cluster.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/weave/cluster.yaml index 8078d60a1a..4d25d7bad3 100644 --- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/weave/cluster.yaml +++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/weave/cluster.yaml @@ -19,7 +19,7 @@ spec: name: master-us-test-1a name: events iam: {} - kubernetesVersion: v1.19.0 + kubernetesVersion: v1.20.0 masterInternalName: api.internal.minimal.example.com masterPublicName: api.minimal.example.com networkCIDR: 172.20.0.0/16