diff --git a/cmd/kops/create_cluster_integration_test.go b/cmd/kops/create_cluster_integration_test.go index 9c566b792e..92f150f3e7 100644 --- a/cmd/kops/create_cluster_integration_test.go +++ b/cmd/kops/create_cluster_integration_test.go @@ -49,6 +49,7 @@ func TestCreateClusterMinimal(t *testing.T) { runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.18", "v1alpha2") runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.19", "v1alpha2") runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.20", "v1alpha2") + runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.21", "v1alpha2") } // TestCreateClusterOverride tests the override flag diff --git a/pkg/model/components/docker.go b/pkg/model/components/docker.go index 6c280aa879..29e5972357 100644 --- a/pkg/model/components/docker.go +++ b/pkg/model/components/docker.go @@ -47,7 +47,9 @@ func (b *DockerOptionsBuilder) BuildOptions(o interface{}) error { // Set the Docker version for known Kubernetes versions if fi.StringValue(clusterSpec.Docker.Version) == "" { - if b.IsKubernetesGTE("1.17") { + if b.IsKubernetesGTE("1.21") { + docker.Version = fi.String("20.10.5") + } else if b.IsKubernetesGTE("1.17") { docker.Version = fi.String("19.03.15") } else if b.IsKubernetesGTE("1.16") { docker.Version = fi.String("18.09.9") diff --git a/tests/integration/create_cluster/minimal-1.21/expected-v1alpha2.yaml b/tests/integration/create_cluster/minimal-1.21/expected-v1alpha2.yaml new file mode 100644 index 0000000000..6eece505d3 --- /dev/null +++ b/tests/integration/create_cluster/minimal-1.21/expected-v1alpha2.yaml @@ -0,0 +1,94 @@ +apiVersion: kops.k8s.io/v1alpha2 +kind: Cluster +metadata: + creationTimestamp: "2017-01-01T00:00:00Z" + name: minimal.example.com +spec: + api: + dns: {} + authorization: + rbac: {} + channel: stable + cloudProvider: aws + configBase: memfs://tests/minimal.example.com + containerRuntime: containerd + etcdClusters: + - cpuRequest: 200m + etcdMembers: + - encryptedVolume: true + instanceGroup: master-us-test-1a + name: a + memoryRequest: 100Mi + name: main + - cpuRequest: 100m + etcdMembers: + - encryptedVolume: true + instanceGroup: master-us-test-1a + name: a + memoryRequest: 100Mi + name: events + iam: + allowContainerRegistry: true + legacy: false + kubelet: + anonymousAuth: false + kubernetesApiAccess: + - 0.0.0.0/0 + kubernetesVersion: v1.21.0 + masterPublicName: api.minimal.example.com + networkCIDR: 172.20.0.0/16 + networking: + cni: {} + nonMasqueradeCIDR: 100.64.0.0/10 + sshAccess: + - 0.0.0.0/0 + subnets: + - cidr: 172.20.32.0/19 + name: us-test-1a + type: Public + zone: us-test-1a + topology: + dns: + type: Public + masters: public + nodes: public + +--- + +apiVersion: kops.k8s.io/v1alpha2 +kind: InstanceGroup +metadata: + creationTimestamp: "2017-01-01T00:00:00Z" + labels: + kops.k8s.io/cluster: minimal.example.com + name: master-us-test-1a +spec: + image: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20210315 + machineType: m3.medium + maxSize: 1 + minSize: 1 + nodeLabels: + kops.k8s.io/instancegroup: master-us-test-1a + role: Master + subnets: + - us-test-1a + +--- + +apiVersion: kops.k8s.io/v1alpha2 +kind: InstanceGroup +metadata: + creationTimestamp: "2017-01-01T00:00:00Z" + labels: + kops.k8s.io/cluster: minimal.example.com + name: nodes-us-test-1a +spec: + image: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20210315 + machineType: t2.medium + maxSize: 1 + minSize: 1 + nodeLabels: + kops.k8s.io/instancegroup: nodes-us-test-1a + role: Node + subnets: + - us-test-1a diff --git a/tests/integration/create_cluster/minimal-1.21/options.yaml b/tests/integration/create_cluster/minimal-1.21/options.yaml new file mode 100644 index 0000000000..1c0e816cc9 --- /dev/null +++ b/tests/integration/create_cluster/minimal-1.21/options.yaml @@ -0,0 +1,6 @@ +ClusterName: minimal.example.com +Zones: +- us-test-1a +CloudProvider: aws +Networking: cni +KubernetesVersion: v1.21.0 diff --git a/tests/integration/update_cluster/docker-custom/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/docker-custom/cloudformation.json.extracted.yaml index 650ff753a4..25769a7fa2 100644 --- a/tests/integration/update_cluster/docker-custom/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/docker-custom/cloudformation.json.extracted.yaml @@ -160,7 +160,7 @@ Resources.AWSEC2LaunchTemplatemasterustest1amastersdockerexamplecom.Properties.L urlAmd64: https://download.docker.com/linux/static/stable/x86_64/docker-20.10.1.tgz urlArm64: https://download.docker.com/linux/static/stable/aarch64/docker-20.10.1.tgz storage: overlay2,overlay,aufs - version: 19.03.15 + version: 20.10.5 encryptionConfig: null etcdClusters: events: @@ -492,7 +492,7 @@ Resources.AWSEC2LaunchTemplatenodesdockerexamplecom.Properties.LaunchTemplateDat urlAmd64: https://download.docker.com/linux/static/stable/x86_64/docker-20.10.1.tgz urlArm64: https://download.docker.com/linux/static/stable/aarch64/docker-20.10.1.tgz storage: overlay2,overlay,aufs - version: 19.03.15 + version: 20.10.5 kubeProxy: clusterCIDR: 100.96.0.0/11 cpuRequest: 100m diff --git a/upup/pkg/fi/cloudup/docker.go b/upup/pkg/fi/cloudup/docker.go index 67b9d3322c..aa06fefc9c 100644 --- a/upup/pkg/fi/cloudup/docker.go +++ b/upup/pkg/fi/cloudup/docker.go @@ -195,6 +195,8 @@ func findAllDockerHashesAmd64() map[string]string { "20.10.1": "8790f3b94ee07ca69a9fdbd1310cbffc729af0a07e5bf9f34a79df1e13d2e50e", "20.10.2": "97017e32a8ecbdd1826bb3c7b1424303ee0dea3f900d33591b1df5e394ed4eed", "20.10.3": "47065a47f0692cd5af03073c7386fe090d9ef5ac88a7d8455a884d8e15809be5", + "20.10.4": "6ec28b6a251e093f5cf32569c4bfce4821eda02923b33c060694e6ca2c851daa", + "20.10.5": "3f18edc66e1faae607d428349e77f9800bdea554528521f0f6c49fc3f1de6abf", } return hashes @@ -242,6 +244,8 @@ func findAllDockerHashesArm64() map[string]string { "20.10.1": "ec2a42e52614e835b373f3f5c090e2f6a8a333ea52fa02ab9d8f4ac74a2f90d5", "20.10.2": "9ea59f249ae92bbaa9831a22f2affa2edc9e824f9daaba831ca51d6d22ef2df5", "20.10.3": "4dcd105f721297f314bb53622e67dd981a743d72f4b2bfe4f42a8790e0892c82", + "20.10.4": "bd9fb2f770eb508b3273237c5604266b6cd93789d048069bd6b16efbf8919fca", + "20.10.5": "83157b92d7469117c2720fc44074749e080b3c510ae35b8a57c66a016cf07dd5", } return hashes diff --git a/upup/pkg/fi/cloudup/populatecluster_test.go b/upup/pkg/fi/cloudup/populatecluster_test.go index a114480e77..ea9934b3d9 100644 --- a/upup/pkg/fi/cloudup/populatecluster_test.go +++ b/upup/pkg/fi/cloudup/populatecluster_test.go @@ -392,11 +392,16 @@ func TestPopulateCluster_DockerVersion(t *testing.T) { KubernetesVersion: "1.17.0", DockerVersion: "19.03.15", }, + { + KubernetesVersion: "1.21.0", + DockerVersion: "20.10.5", + }, } for _, test := range grid { _, c := buildMinimalCluster() c.Spec.KubernetesVersion = test.KubernetesVersion + c.Spec.ContainerRuntime = "docker" full, err := build(c) if err != nil {