diff --git a/.github/workflows/ostests-matrix.yaml b/.github/workflows/ostests-matrix.yaml index 970f2a80ece7..a53c24ee63e7 100644 --- a/.github/workflows/ostests-matrix.yaml +++ b/.github/workflows/ostests-matrix.yaml @@ -23,7 +23,7 @@ on: default: >- [ "al2023", - "alpine_3_17", + "alpine_3_17", "alpine_3_20", "centos_7", "centos_8", "centos_9", "debian_10", "debian_11", "debian_12", "fcos_38", diff --git a/.github/workflows/ostests-nightly.yaml b/.github/workflows/ostests-nightly.yaml index a99f7b928ac3..839bb01e8309 100644 --- a/.github/workflows/ostests-nightly.yaml +++ b/.github/workflows/ostests-nightly.yaml @@ -11,7 +11,7 @@ env: DISTRIBUTIONS: >- [ ["al2023"], - ["alpine_3_17"], + ["alpine_3_17", "alpine_3_20"], ["centos_7", "centos_8", "centos_9"], ["debian_10", "debian_11", "debian_12"], ["fcos_38"], diff --git a/hack/ostests/README.md b/hack/ostests/README.md index 36fb09e07b33..d100af3f3184 100644 --- a/hack/ostests/README.md +++ b/hack/ostests/README.md @@ -48,7 +48,7 @@ Select the desired cluster configuration for Terraform. Again, just an example, other ways described [here][tf-config]. ```shell -export TF_VAR_os=alpine_3_17 +export TF_VAR_os=alpine_3_20 export TF_VAR_arch=x86_64 export TF_VAR_k0s_version=stable export TF_VAR_k0s_network_provider=calico @@ -69,7 +69,8 @@ terraform apply ### `os`: Operating system stack * `al2023`: Amazon Linux 2023 -* `alpine_3_17`: Alpine Linux 3.17 +* `alpine_3_20`: Alpine Linux 3.17 +* `alpine_3_20`: Alpine Linux 3.20 * `centos_7`: CentOS Linux 7 (Core) * `centos_8`: CentOS Stream 8 * `centos_9`: CentOS Stream 9 @@ -108,7 +109,7 @@ Assuming the AWS credentials are available, it can be used like this: ```sh terraform init -export TF_VAR_os=alpine_3_17 +export TF_VAR_os=alpine_3_20 export TF_VAR_k0sctl_skip=true terraform apply terraform output -json | jq -r ' @@ -165,7 +166,7 @@ workflow] that exposes more knobs and can be triggered manually, e.g. via [gh]: ```console $ gh workflow run ostests-matrix.yaml --ref some/experimental/branch \ - -f oses='["alpine_3_17"]' \ + -f oses='["alpine_3_20"]' \ -f network-providers='["calico"]' ✓ Created workflow_dispatch event for ostests-matrix.yaml at some/experimental/branch diff --git a/hack/ostests/modules/os/main.tf b/hack/ostests/modules/os/main.tf index cfeea26468b3..0e107672122a 100644 --- a/hack/ostests/modules/os/main.tf +++ b/hack/ostests/modules/os/main.tf @@ -4,6 +4,7 @@ locals { os = { al2023 = local.os_al2023 alpine_3_17 = local.os_alpine_3_17 + alpine_3_20 = local.os_alpine_3_20 centos_7 = local.os_centos_7 centos_8 = local.os_centos_8 centos_9 = local.os_centos_9 diff --git a/hack/ostests/modules/os/os_alpine_3_17.tf b/hack/ostests/modules/os/os_alpine_3_17.tf index 3110f71a88bc..e97dcb8aeeb9 100644 --- a/hack/ostests/modules/os/os_alpine_3_17.tf +++ b/hack/ostests/modules/os/os_alpine_3_17.tf @@ -43,8 +43,8 @@ locals { default = { ami_id = one(data.aws_ami.alpine_3_17.*.id) - user_data = templatefile("${path.module}/os_alpine_3_17_userdata.tftpl", { worker = true }) - ready_script = file("${path.module}/os_alpine_3_17_ready.sh") + user_data = templatefile("${path.module}/os_alpine_userdata.tftpl", { worker = true }) + ready_script = file("${path.module}/os_alpine_ready.sh") connection = { type = "ssh" @@ -52,7 +52,7 @@ locals { } } controller = { - user_data = templatefile("${path.module}/os_alpine_3_17_userdata.tftpl", { worker = false }) + user_data = templatefile("${path.module}/os_alpine_userdata.tftpl", { worker = false }) } } } diff --git a/hack/ostests/modules/os/os_alpine_3_20.tf b/hack/ostests/modules/os/os_alpine_3_20.tf new file mode 100644 index 000000000000..7a09ea086f5c --- /dev/null +++ b/hack/ostests/modules/os/os_alpine_3_20.tf @@ -0,0 +1,50 @@ +# https://www.alpinelinux.org/cloud/ + +data "aws_ami" "alpine_3_20" { + count = var.os == "alpine_3_20" ? 1 : 0 + + owners = ["538276064493"] + name_regex = "^alpine-3\\.20\\.\\d+-(aarch64|x86_64)-uefi-tiny($|-.*)" + most_recent = true + + filter { + name = "name" + values = ["alpine-3.20.*-*-uefi-tiny*"] + } + + filter { + name = "architecture" + values = [var.arch] + } + + filter { + name = "root-device-type" + values = ["ebs"] + } + + filter { + name = "virtualization-type" + values = ["hvm"] + } +} + +locals { + os_alpine_3_20 = var.os != "alpine_3_20" ? {} : { + node_configs = { + default = { + ami_id = one(data.aws_ami.alpine_3_20.*.id) + + user_data = templatefile("${path.module}/os_alpine_userdata.tftpl", { worker = true }) + ready_script = file("${path.module}/os_alpine_ready.sh") + + connection = { + type = "ssh" + username = "alpine" + } + } + controller = { + user_data = templatefile("${path.module}/os_alpine_userdata.tftpl", { worker = false }) + } + } + } +} diff --git a/hack/ostests/modules/os/os_alpine_3_17_ready.sh b/hack/ostests/modules/os/os_alpine_ready.sh similarity index 100% rename from hack/ostests/modules/os/os_alpine_3_17_ready.sh rename to hack/ostests/modules/os/os_alpine_ready.sh diff --git a/hack/ostests/modules/os/os_alpine_3_17_userdata.tftpl b/hack/ostests/modules/os/os_alpine_userdata.tftpl similarity index 100% rename from hack/ostests/modules/os/os_alpine_3_17_userdata.tftpl rename to hack/ostests/modules/os/os_alpine_userdata.tftpl