mirror of
https://github.com/puppetmaster/typhoon.git
synced 2024-12-26 07:29:32 +01:00
beb9f1477a
* Add `arch` variable to Flatcar Linux AWS `kubernetes` and `workers` modules. Accept `amd64` (default) or `arm64` to support native arm64/aarch64 clusters or mixed/hybrid clusters with arm64 workers * Requires `flannel` or `cilium` CNI Similar to https://github.com/poseidon/typhoon/pull/875
49 lines
877 B
HCL
49 lines
877 B
HCL
locals {
|
|
# Pick a Flatcar Linux AMI
|
|
# flatcar-stable -> Flatcar Linux AMI
|
|
ami_id = var.arch == "arm64" ? data.aws_ami.flatcar-arm64[0].image_id : data.aws_ami.flatcar.image_id
|
|
channel = split("-", var.os_image)[1]
|
|
}
|
|
|
|
data "aws_ami" "flatcar" {
|
|
most_recent = true
|
|
owners = ["075585003325"]
|
|
|
|
filter {
|
|
name = "architecture"
|
|
values = ["x86_64"]
|
|
}
|
|
|
|
filter {
|
|
name = "virtualization-type"
|
|
values = ["hvm"]
|
|
}
|
|
|
|
filter {
|
|
name = "name"
|
|
values = ["Flatcar-${local.channel}-*"]
|
|
}
|
|
}
|
|
|
|
data "aws_ami" "flatcar-arm64" {
|
|
count = var.arch == "arm64" ? 1 : 0
|
|
|
|
most_recent = true
|
|
owners = ["075585003325"]
|
|
|
|
filter {
|
|
name = "architecture"
|
|
values = ["arm64"]
|
|
}
|
|
|
|
filter {
|
|
name = "virtualization-type"
|
|
values = ["hvm"]
|
|
}
|
|
|
|
filter {
|
|
name = "name"
|
|
values = ["Flatcar-${local.channel}-*"]
|
|
}
|
|
}
|