Skip to content

Commit

Permalink
Depreciate 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
sayboras committed May 5, 2020
1 parent 597ea9c commit b6dcfe3
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 78 deletions.
8 changes: 4 additions & 4 deletions docs/proposal-005-upgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ command also. However, there may be additional manual steps with some versions,
should be automated.

When upgrading a cluster, one needs to call `eks.UpdateClusterVersion`. In some cases other changes
to cluster stack may be required. After that they need to replace nodegroups one by one.
to cluster stack may be required. After that they need to replace nodegroups one by one.

## Initial phase

Expand Down Expand Up @@ -95,10 +95,10 @@ It should be possible to provide simple command under utils for each of these.
At the time of writing of this proposal version downgrades were not supported by EKS.
It's trusted that upgrades will work as expected with EKS SLA.

More specifically, an `eks.UpdateClusterVersion` call for cluster running 1.12+ trying
to go back to 1.10 or 1.11 results in the following error:
More specifically, an `eks.UpdateClusterVersion` call for cluster running 1.13+ trying
to go back to 1.10, 1.11 or 1.12 results in the following error:
```
An error occurred (InvalidParameterException) when calling the UpdateClusterVersion operation: unsupported Kubernetes version update from the current version, 1.11, to 1.10
An error occurred (InvalidParameterException) when calling the UpdateClusterVersion operation: unsupported Kubernetes version update from the current version, 1.12 to 1.10
```

## General Config Changes
Expand Down
48 changes: 21 additions & 27 deletions pkg/addons/default/coredns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var _ = Describe("default addons - coredns", func() {

loadSample := func(kubernetesVersion string, expectCount int) {
samplePath := "testdata/sample-" + kubernetesVersion + ".json"
It("can load "+samplePath+" and create objests that don't exist", func() {
It("can load "+samplePath+" and create objects that don't exist", func() {
rawClient = testutils.NewFakeRawClient()

sampleAddons := testutils.LoadSamples(samplePath)
Expand Down Expand Up @@ -73,20 +73,26 @@ var _ = Describe("default addons - coredns", func() {
})
}

loadSampleAndCheck("1.11", "1.1.3")
loadSampleAndCheck("1.12", "1.2.2")

Context("[1.11 –> 1.12] can update coredns", func() {
Context("[1.12 –> 1.13] can update coredns", func() {

loadSample("1.11", 10)
loadSample("1.12", 10)

It("can load 1.11 sample", func() {
checkCoreDNSImage(rawClient, "eu-west-1", "v1.1.3", true)
It("can load 1.12 sample", func() {
checkCoreDNSImage(rawClient, "eu-west-1", "v1.2.2", true)
})

It("detects coredns version match local vs cluster", func() {
needsUpdate, err := UpdateCoreDNS(rawClient, "eu-west-2", "1.13.x", true)
Expect(err).ToNot(HaveOccurred())
Expect(needsUpdate).To(BeTrue())
})

It("can update to correct version", func() {
_, err := UpdateCoreDNS(rawClient, "eu-west-2", "1.12.x", false)
_, err := UpdateCoreDNS(rawClient, "eu-west-2", "1.13.x", false)
Expect(err).ToNot(HaveOccurred())
checkCoreDNSImage(rawClient, "eu-west-2", "v1.2.2", false)
checkCoreDNSImage(rawClient, "eu-west-2", "v1.2.6", false)

createReqs := []string{
"POST [/clusterrolebindings] (aws-node)",
Expand Down Expand Up @@ -122,30 +128,20 @@ var _ = Describe("default addons - coredns", func() {
})
})

loadSampleAndCheck("1.12", "1.2.2")

Context("[1.12 –> 1.13] can update coredns", func() {
loadSampleAndCheck("1.13", "1.2.6")

loadSample("1.12", 10)
Context("[1.13 –> 1.14] can update coredns", func() {

It("can load 1.11 sample", func() {
checkCoreDNSImage(rawClient, "eu-west-1", "v1.2.2", true)
})

It("detects coredns version match local vs cluster", func() {
needsUpdate, err := UpdateCoreDNS(rawClient, "eu-west-2", "1.12.x", true)
Expect(err).ToNot(HaveOccurred())
Expect(needsUpdate).To(BeFalse())
loadSample("1.13", 10)

needsUpdate, err = UpdateCoreDNS(rawClient, "eu-west-2", "1.13.x", true)
Expect(err).ToNot(HaveOccurred())
Expect(needsUpdate).To(BeTrue())
It("can load 1.13 sample", func() {
checkCoreDNSImage(rawClient, "eu-west-1", "v1.2.6", true)
})

It("can update to correct version", func() {
_, err := UpdateCoreDNS(rawClient, "eu-west-2", "1.13.x", false)
_, err := UpdateCoreDNS(rawClient, "eu-west-2", "1.14.x", false)
Expect(err).ToNot(HaveOccurred())
checkCoreDNSImage(rawClient, "eu-west-2", "v1.2.6", false)
checkCoreDNSImage(rawClient, "eu-west-2", "v1.6.6", false)

createReqs := []string{
"POST [/clusterrolebindings] (aws-node)",
Expand Down Expand Up @@ -180,8 +176,6 @@ var _ = Describe("default addons - coredns", func() {
}
})
})

loadSampleAndCheck("1.13", "1.2.6")
})

func checkCoreDNSImage(rawClient *testutils.FakeRawClient, region, imageTag string, setImage bool) {
Expand Down
12 changes: 6 additions & 6 deletions pkg/ami/auto_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var _ = Describe("AMI Auto Resolution", func() {
Context("with a valid region and N instance type", func() {
BeforeEach(func() {
region = "eu-west-1"
version = "1.12"
version = "1.15"
expectedAmi = "ami-12345"
})

Expand All @@ -78,7 +78,7 @@ var _ = Describe("AMI Auto Resolution", func() {
imageState = "available"

_, p = createProviders()
addMockDescribeImages(p, "amazon-eks-node-1.12-v*", expectedAmi, imageState, "2018-08-20T23:25:53.000Z", api.NodeImageFamilyAmazonLinux2)
addMockDescribeImages(p, "amazon-eks-node-1.15-v*", expectedAmi, imageState, "2018-08-20T23:25:53.000Z", api.NodeImageFamilyAmazonLinux2)
resolver := NewAutoResolver(p.MockEC2())
resolvedAmi, err = resolver.Resolve(region, version, instanceType, imageFamily)
})
Expand All @@ -102,7 +102,7 @@ var _ = Describe("AMI Auto Resolution", func() {
imageFamily = "Ubuntu1804"

_, p = createProviders()
addMockDescribeImages(p, "ubuntu-eks/k8s_1.12/images/*", expectedAmi, imageState, "2018-08-20T23:25:53.000Z", api.NodeImageFamilyUbuntu1804)
addMockDescribeImages(p, "ubuntu-eks/k8s_1.15/images/*", expectedAmi, imageState, "2018-08-20T23:25:53.000Z", api.NodeImageFamilyUbuntu1804)

resolver := NewAutoResolver(p.MockEC2())
resolvedAmi, err = resolver.Resolve(region, version, instanceType, imageFamily)
Expand All @@ -126,7 +126,7 @@ var _ = Describe("AMI Auto Resolution", func() {
imageState = "pending"

_, p = createProviders()
addMockDescribeImagesMultiple(p, "amazon-eks-node-1.12-v*", []returnAmi{})
addMockDescribeImagesMultiple(p, "amazon-eks-node-1.15-v*", []returnAmi{})

resolver := NewAutoResolver(p.MockEC2())
resolvedAmi, err = resolver.Resolve(region, version, instanceType, imageFamily)
Expand Down Expand Up @@ -164,7 +164,7 @@ var _ = Describe("AMI Auto Resolution", func() {
},
}

addMockDescribeImagesMultiple(p, "amazon-eks-node-1.12-v*", images)
addMockDescribeImagesMultiple(p, "amazon-eks-node-1.15-v*", images)

resolver := NewAutoResolver(p.MockEC2())
resolvedAmi, err = resolver.Resolve(region, version, instanceType, imageFamily)
Expand Down Expand Up @@ -194,7 +194,7 @@ var _ = Describe("AMI Auto Resolution", func() {
imageState = "available"

_, p = createProviders()
addMockDescribeImages(p, "amazon-eks-gpu-node-1.12-*", expectedAmi, imageState, "2018-08-20T23:25:53.000Z", api.NodeImageFamilyAmazonLinux2)
addMockDescribeImages(p, "amazon-eks-gpu-node-1.15-*", expectedAmi, imageState, "2018-08-20T23:25:53.000Z", api.NodeImageFamilyAmazonLinux2)
resolver := NewAutoResolver(p.MockEC2())
resolvedAmi, err = resolver.Resolve(region, version, instanceType, imageFamily)
})
Expand Down
48 changes: 24 additions & 24 deletions pkg/ami/static_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,66 +35,66 @@ var _ = Describe("AMI Static Resolution", func() {
},
Entry("with non-gpu instance and us-west-2", ResolveCase{
Region: "us-west-2",
Version: "1.12",
Version: "1.14",
InstanceType: "t2.medium",
ImageFamily: "AmazonLinux2",
ExpectedAMI: "ami-0267968f4310157f1",
ExpectedAMI: "ami-0c13bb9cbfd007e56",
ExpectError: false,
}),
Entry("with non-gpu instance and us-east-1", ResolveCase{
Region: "us-east-1",
Version: "1.12",
Version: "1.14",
InstanceType: "t2.medium",
ImageFamily: "AmazonLinux2",
ExpectedAMI: "ami-007092a89ede24e62",
ExpectedAMI: "ami-087a82f6b78a07557",
ExpectError: false,
}),
Entry("with non-gpu instance and eu-west-1", ResolveCase{
Region: "eu-west-1",
Version: "1.12",
Version: "1.14",
InstanceType: "t2.medium",
ImageFamily: "AmazonLinux2",
ExpectedAMI: "ami-05961b098762d431f",
ExpectedAMI: "ami-0b9d2c11b47bd8264",
ExpectError: false,
}),
Entry("with non-gpu instance and non-eks enabled region", ResolveCase{
Region: "ap-northeast-3",
Version: "1.12",
Version: "1.14",
InstanceType: "t2.medium",
ImageFamily: "AmazonLinux2",
ExpectedAMI: "",
ExpectError: true,
}),
Entry("with gpu (p2) instance and us-west-2", ResolveCase{
Region: "us-west-2",
Version: "1.12",
Version: "1.14",
InstanceType: "p2.xlarge",
ImageFamily: "AmazonLinux2",
ExpectedAMI: "ami-02551cb499388bebb",
ExpectedAMI: "ami-0ad9a8dc09680cfc2",
ExpectError: false,
}),
Entry("with gpu (p3) instance and us-east-1", ResolveCase{
Region: "us-east-1",
Version: "1.12",
Version: "1.14",
InstanceType: "p3.2xlarge",
ImageFamily: "AmazonLinux2",
ExpectedAMI: "ami-0196913a4743888c0",
ExpectedAMI: "ami-0730212bffaa1732a",
ExpectError: false,
}),
Entry("with gpu (p2) instance and eu-west-1", ResolveCase{
Region: "eu-west-1",
Version: "1.12",
Version: "1.14",
InstanceType: "p2.xlarge",
ImageFamily: "AmazonLinux2",
ExpectedAMI: "ami-01133c5344c522d27",
ExpectedAMI: "ami-03b8e736123fd2b9b",
ExpectError: false,
}),
Entry("with gpu (g3) instance and eu-west-1", ResolveCase{
Region: "eu-west-1",
Version: "1.12",
Version: "1.14",
InstanceType: "g3.4xlarge",
ImageFamily: "AmazonLinux2",
ExpectedAMI: "ami-01133c5344c522d27",
ExpectedAMI: "ami-03b8e736123fd2b9b",
ExpectError: false,
}),
Entry("with gpu (g4dn) instance and us-east-1", ResolveCase{
Expand All @@ -107,47 +107,47 @@ var _ = Describe("AMI Static Resolution", func() {
}),
Entry("with gpu (p3) instance and non-existent region", ResolveCase{
Region: "eu-east-1",
Version: "1.12",
Version: "1.14",
InstanceType: "p3.2xlarge",
ImageFamily: "AmazonLinux2",
ExpectedAMI: "",
ExpectError: true,
}),
Entry("with non-gpu instance, us-west-2 and Ubuntu image", ResolveCase{
Region: "us-west-2",
Version: "1.12",
Version: "1.14",
InstanceType: "t2.medium",
ImageFamily: "Ubuntu1804",
ExpectedAMI: "ami-0e491bf7958a81442",
ExpectedAMI: "ami-0722493f75c013523",
ExpectError: false,
}),
Entry("with non-gpu instance, us-east-1 and Ubuntu image", ResolveCase{
Region: "us-east-1",
Version: "1.12",
Version: "1.14",
InstanceType: "t2.medium",
ImageFamily: "Ubuntu1804",
ExpectedAMI: "ami-031e0d347e9a5f166",
ExpectedAMI: "ami-093abf0b4d2d071df",
ExpectError: false,
}),
Entry("with non-gpu instance, eu-west-1 and Ubuntu image", ResolveCase{
Region: "eu-west-1",
Version: "1.12",
Version: "1.14",
InstanceType: "t2.medium",
ImageFamily: "Ubuntu1804",
ExpectedAMI: "ami-096baaf9c815031d6",
ExpectedAMI: "ami-0dd0a16a2bd0784b8",
ExpectError: false,
}),
Entry("with non-gpu instance, non-eks enabled region and Ubuntu image", ResolveCase{
Region: "ap-northeast-3",
Version: "1.12",
Version: "1.14",
InstanceType: "t2.medium",
ImageFamily: "Ubuntu1804",
ExpectedAMI: "",
ExpectError: true,
}),
Entry("with gpu instance, any region and Ubuntu image", ResolveCase{
Region: "us-east-1",
Version: "1.12",
Version: "1.14",
InstanceType: "p2.xlarge",
ImageFamily: "Ubuntu1804",
ExpectedAMI: "",
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/eksctl.io/v1alpha5/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,13 @@ func DeprecatedVersions() []string {
return []string{
Version1_10,
Version1_11,
Version1_12,
}
}

// SupportedVersions are the versions of Kubernetes that EKS supports
func SupportedVersions() []string {
return []string{
Version1_12,
Version1_13,
Version1_14,
Version1_15,
Expand Down
16 changes: 8 additions & 8 deletions pkg/eks/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ var _ = Describe("eksctl API", func() {
ng.AMI = "static"
ng.InstanceType = "p2.xlarge"

err := EnsureAMI(provider, "1.12", ng)
err := EnsureAMI(provider, "1.14", ng)

Expect(err).ToNot(HaveOccurred())
Expect(ng.AMI).To(Equal("ami-02551cb499388bebb"))
Expect(ng.AMI).To(Equal("ami-0ad9a8dc09680cfc2"))
})
It("should pick a valid AMI for normal instances when AMI is static", func() {
ng.AMI = "static"
ng.InstanceType = "m5.xlarge"

err := EnsureAMI(provider, "1.12", ng)
err := EnsureAMI(provider, "1.14", ng)

Expect(err).ToNot(HaveOccurred())
Expect(ng.AMI).To(Equal("ami-0267968f4310157f1"))
Expect(ng.AMI).To(Equal("ami-0c13bb9cbfd007e56"))
})
It("should pick a valid AMI for mixed normal instances", func() {
ng.AMI = "static"
Expand All @@ -115,10 +115,10 @@ var _ = Describe("eksctl API", func() {
InstanceTypes: []string{"t3.large", "m5.large", "m5a.large"},
}

err := EnsureAMI(provider, "1.12", ng)
err := EnsureAMI(provider, "1.14", ng)

Expect(err).ToNot(HaveOccurred())
Expect(ng.AMI).To(Equal("ami-0267968f4310157f1"))
Expect(ng.AMI).To(Equal("ami-0c13bb9cbfd007e56"))
})
It("should pick a GPU AMI for mixed instances with GPU instance types", func() {
ng.AMI = "static"
Expand All @@ -127,10 +127,10 @@ var _ = Describe("eksctl API", func() {
InstanceTypes: []string{"t3.large", "m5.large", "m5a.large", "p3.2xlarge"},
}

err := EnsureAMI(provider, "1.12", ng)
err := EnsureAMI(provider, "1.14", ng)

Expect(err).ToNot(HaveOccurred())
Expect(ng.AMI).To(Equal("ami-02551cb499388bebb"))
Expect(ng.AMI).To(Equal("ami-0ad9a8dc09680cfc2"))
})
})

Expand Down
2 changes: 1 addition & 1 deletion pkg/elb/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func getSecurityGroupsOwnedByLoadBalancer(ctx context.Context, ec2API ec2iface.E
}

func getLoadBalancerKind(service *corev1.Service) int {
// See https://github.com/kubernetes/kubernetes/blob/v1.12.6/pkg/cloudprovider/providers/aws/aws_loadbalancer.go#L51-L56
// See https://github.com/kubernetes/legacy-cloud-providers/blob/master/aws/aws_loadbalancer.go#L65-L70
if service.Annotations[awsprovider.ServiceAnnotationLoadBalancerType] == "nlb" {
return loadBalancerKindNetwork
}
Expand Down
Loading

0 comments on commit b6dcfe3

Please sign in to comment.