mirror of
https://github.com/puppetmaster/typhoon.git
synced 2025-07-21 18:01:32 +02:00
Configure controller and worker node architecture separately
* On platforms that support ARM64 instances, configure controller and worker node host architectures separately * For example, you can run arm64 controllers and amd64 workers * Add `controller_arch` and `worker_arch` variables * Remove `arch` variable
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
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
|
||||
ami_id = var.controller_arch == "arm64" ? data.aws_ami.flatcar-arm64[0].image_id : data.aws_ami.flatcar.image_id
|
||||
channel = split("-", var.os_image)[1]
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ data "aws_ami" "flatcar" {
|
||||
}
|
||||
|
||||
data "aws_ami" "flatcar-arm64" {
|
||||
count = var.arch == "arm64" ? 1 : 0
|
||||
count = var.controller_arch == "arm64" ? 1 : 0
|
||||
|
||||
most_recent = true
|
||||
owners = ["075585003325"]
|
||||
|
@ -190,17 +190,27 @@ variable "cluster_domain_suffix" {
|
||||
default = "cluster.local"
|
||||
}
|
||||
|
||||
variable "arch" {
|
||||
variable "controller_arch" {
|
||||
type = string
|
||||
description = "Container architecture (amd64 or arm64)"
|
||||
description = "Controller node(s) architecture (amd64 or arm64)"
|
||||
default = "amd64"
|
||||
|
||||
validation {
|
||||
condition = var.arch == "amd64" || var.arch == "arm64"
|
||||
error_message = "The arch must be amd64 or arm64."
|
||||
condition = contains(["amd64", "arm64"], var.controller_arch)
|
||||
error_message = "The controller_arch must be amd64 or arm64."
|
||||
}
|
||||
}
|
||||
|
||||
variable "worker_arch" {
|
||||
type = string
|
||||
description = "Worker node(s) architecture (amd64 or arm64)"
|
||||
default = "amd64"
|
||||
validation {
|
||||
condition = contains(["amd64", "arm64"], var.worker_arch)
|
||||
error_message = "The worker_arch must be amd64 or arm64."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
variable "daemonset_tolerations" {
|
||||
type = list(string)
|
||||
description = "List of additional taint keys kube-system DaemonSets should tolerate (e.g. ['custom-role', 'gpu-role'])"
|
||||
|
@ -9,7 +9,7 @@ module "workers" {
|
||||
worker_count = var.worker_count
|
||||
instance_type = var.worker_type
|
||||
os_image = var.os_image
|
||||
arch = var.arch
|
||||
arch = var.worker_arch
|
||||
disk_type = var.worker_disk_type
|
||||
disk_size = var.worker_disk_size
|
||||
disk_iops = var.worker_disk_iops
|
||||
|
Reference in New Issue
Block a user