Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Ubuntu 22.04 (Jammy) as the default distro for K8s 1.27+ #15475

Merged
merged 2 commits into from
Jun 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions channels/alpha
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,19 @@ spec:
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20230502
providerID: aws
architectureID: amd64
kubernetesVersion: ">=1.18.0"
kubernetesVersion: ">=1.18.0 <1.27.0"
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-20230502
providerID: aws
architectureID: arm64
kubernetesVersion: ">=1.20.0"
kubernetesVersion: ">=1.20.0 <1.27.0"
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20230601
providerID: aws
architectureID: amd64
kubernetesVersion: ">=1.27.0"
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-arm64-server-20230601
providerID: aws
architectureID: arm64
kubernetesVersion: ">=1.27.0"
- name: cos-cloud/cos-stable-65-10323-99-0
providerID: gce
architectureID: amd64
Expand All @@ -77,11 +85,19 @@ spec:
- name: ubuntu-os-cloud/ubuntu-2004-focal-v20230302
providerID: gce
architectureID: amd64
kubernetesVersion: ">=1.18.0"
kubernetesVersion: ">=1.18.0 <1.27.0"
- name: ubuntu-os-cloud/ubuntu-2204-jammy-v20230606
providerID: gce
architectureID: amd64
kubernetesVersion: ">=1.27.0"
- name: Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:20.04.202303020
providerID: azure
architectureID: amd64
kubernetesVersion: ">=1.20.0"
kubernetesVersion: ">=1.20.0 <1.27.0"
- name: Canonical:0001-com-ubuntu-server-jammy:22_04-lts-gen2:22.04.202306010
providerID: azure
architectureID: amd64
kubernetesVersion: ">=1.27.0"
cluster:
kubernetesVersion: v1.5.8
networking:
Expand Down
24 changes: 20 additions & 4 deletions channels/stable
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,19 @@ spec:
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20230502
providerID: aws
architectureID: amd64
kubernetesVersion: ">=1.18.0"
kubernetesVersion: ">=1.18.0 <1.27.0"
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-20230502
providerID: aws
architectureID: arm64
kubernetesVersion: ">=1.20.0"
kubernetesVersion: ">=1.20.0 <1.27.0"
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20230601
providerID: aws
architectureID: amd64
kubernetesVersion: ">=1.27.0"
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-arm64-server-20230601
providerID: aws
architectureID: arm64
kubernetesVersion: ">=1.27.0"
- name: cos-cloud/cos-stable-65-10323-99-0
providerID: gce
architectureID: amd64
Expand All @@ -77,11 +85,19 @@ spec:
- name: ubuntu-os-cloud/ubuntu-2004-focal-v20230302
providerID: gce
architectureID: amd64
kubernetesVersion: ">=1.18.0"
kubernetesVersion: ">=1.18.0 <1.27.0"
- name: ubuntu-os-cloud/ubuntu-2204-jammy-v20230606
providerID: gce
architectureID: amd64
kubernetesVersion: ">=1.27.0"
- name: Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:20.04.202303020
providerID: azure
architectureID: amd64
kubernetesVersion: ">=1.20.0"
kubernetesVersion: ">=1.20.0 <1.27.0"
- name: Canonical:0001-com-ubuntu-server-jammy:22_04-lts-gen2:22.04.202306010
providerID: azure
architectureID: amd64
kubernetesVersion: ">=1.27.0"
cluster:
kubernetesVersion: v1.5.8
networking:
Expand Down
1 change: 1 addition & 0 deletions cmd/kops/create_cluster_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func TestCreateClusterMinimal(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.24", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.25", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.26", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.27", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.26-arm64", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.26-irsa", "v1alpha2")
}
Expand Down
13 changes: 13 additions & 0 deletions cmd/kops/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,19 @@ func TestMinimal_v1_26(t *testing.T) {
runTestTerraformAWS(t)
}

// TestMinimal runs the test on a minimum configuration
func TestMinimal_v1_27(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")

newIntegrationTest("minimal.example.com", "minimal-1.27").
withAddons(
awsEBSCSIAddon,
dnsControllerAddon,
awsCCMAddon,
).
runTestTerraformAWS(t)
}

// TestMinimal_NoneDNS runs the test on a minimum configuration with --dns=none
func TestMinimal_NoneDNS(t *testing.T) {
t.Setenv("KOPS_RUN_TOO_NEW_VERSION", "1")
Expand Down
2 changes: 2 additions & 0 deletions docs/releases/1.27-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This is a document to gather the release notes prior to the release.

# Significant changes

* **The default image has been updated to [Ubuntu 22.04 (Jammy)](https://kops.sigs.k8s.io/operations/images/#ubuntu-2204-jammy)**.

* The default retention duration for the etcd backups is now set to 90 days.
This behaviour can be overridden by setting `spec.etcdClusters[*].manager.backupRetentionDays` in the cluster spec.

Expand Down
5 changes: 4 additions & 1 deletion pkg/apis/kops/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,13 @@ func RecommendedKubernetesVersion(c *Channel, kopsVersionString string) *semver.
// Returns true if the given image name has the stable or alpha channel images prefix. Otherwise false.
func (c *Channel) HasUpstreamImagePrefix(image string) bool {
return strings.HasPrefix(image, "kope.io/k8s-") ||
strings.HasPrefix(image, "099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-") ||
strings.HasPrefix(image, "099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-") ||
strings.HasPrefix(image, "cos-cloud/cos-stable-") ||
strings.HasPrefix(image, "ubuntu-os-cloud/ubuntu-2004-focal-") ||
strings.HasPrefix(image, "Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:")
strings.HasPrefix(image, "ubuntu-os-cloud/ubuntu-2204-jammy-") ||
strings.HasPrefix(image, "Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:") ||
strings.HasPrefix(image, "Canonical:0001-com-ubuntu-server-jammy:22_04-lts-gen2:")
}

// GetPackageVersion returns the version for the package, or an error if could not be found.
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/templater/templater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestRenderChannelFunctions(t *testing.T) {
},
{
Context: map[string]interface{}{},
Template: `{{ ChannelRecommendedImage "aws" "1.19.2" "arm64" }}`,
Template: `{{ ChannelRecommendedImage "aws" "1.20.2" "arm64" }}`,
Expected: "099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-20210315",
},
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/channel/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func TestFindImage(t *testing.T) {
ExpectedImage: "099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20210315",
},
{
KubernetesVersion: "1.19.1",
KubernetesVersion: "1.20.1",
Architecture: "arm64",
ExpectedImage: "099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-20210315",
},
Expand Down
12 changes: 10 additions & 2 deletions tests/integration/channel/simple/channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,19 @@ spec:
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20210315
providerID: aws
architectureID: amd64
kubernetesVersion: ">=1.18.0"
kubernetesVersion: ">=1.18.0 <1.27.0"
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-20210315
providerID: aws
architectureID: arm64
kubernetesVersion: ">=1.18.0"
kubernetesVersion: ">=1.20.0 <1.27.0"
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20230601
providerID: aws
architectureID: amd64
kubernetesVersion: ">=1.27.0"
- name: 099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-arm64-server-20230601
providerID: aws
architectureID: arm64
kubernetesVersion: ">=1.27.0"
cluster:
kubernetesVersion: v1.4.7
networking:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
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
etcdClusters:
- cpuRequest: 200m
etcdMembers:
- encryptedVolume: true
instanceGroup: control-plane-us-test-1a
name: a
manager:
backupRetentionDays: 90
memoryRequest: 100Mi
name: main
- cpuRequest: 100m
etcdMembers:
- encryptedVolume: true
instanceGroup: control-plane-us-test-1a
name: a
manager:
backupRetentionDays: 90
memoryRequest: 100Mi
name: events
iam:
allowContainerRegistry: true
legacy: false
kubelet:
anonymousAuth: false
kubernetesApiAccess:
- 0.0.0.0/0
- ::/0
kubernetesVersion: v1.27.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
- ::/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: control-plane-us-test-1a
spec:
image: 099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20230601
machineType: m3.medium
maxSize: 1
minSize: 1
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-jammy-22.04-amd64-server-20230601
machineType: t2.medium
maxSize: 1
minSize: 1
role: Node
subnets:
- us-test-1a
6 changes: 6 additions & 0 deletions tests/integration/create_cluster/minimal-1.27/options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ClusterName: minimal.example.com
Zones:
- us-test-1a
CloudProvider: aws
Networking: cni
KubernetesVersion: v1.27.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "Service": "ec2.amazonaws.com"},
"Action": "sts:AssumeRole"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "Service": "ec2.amazonaws.com"},
"Action": "sts:AssumeRole"
}
]
}
Loading