Skip to content

Commit

Permalink
Put back the main group for now...
Browse files Browse the repository at this point in the history
  • Loading branch information
dj-maisy committed Jan 22, 2025
1 parent ed40bca commit e7af5ae
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
30 changes: 29 additions & 1 deletion terraform/deployments/cluster-infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,34 @@ locals {
secrets_prefix = "govuk"
monitoring_namespace = "monitoring"

main_managed_node_group = {
main = {
name_prefix = var.cluster_name
# TODO: set iam_role_permissions_boundary
# TODO: apply provider default_tags to instances; might need to set launch_template_tags.
desired_size = var.x86_workers_size_desired
max_size = var.x86_workers_size_max
min_size = var.x86_workers_size_min
instance_types = var.main_workers_instance_types
update_config = { max_unavailable = 1 }
block_device_mappings = {
xvda = {
device_name = "/dev/xvda"
ebs = {
volume_size = var.node_disk_size
volume_type = "gp3"
encrypted = true
delete_on_termination = true
}
}
}
additional_tags = {
"k8s.io/cluster-autoscaler/enabled" = "true"
"k8s.io/cluster-autoscaler/${var.cluster_name}" = "owned"
}
}
}

x86_managed_node_group = {
x86 = {
name_prefix = var.cluster_name
Expand Down Expand Up @@ -79,7 +107,7 @@ locals {
}
}

eks_managed_node_groups = merge(var.enable_x86_workers ? local.x86_managed_node_group : {}, var.enable_arm_workers ? local.arm_managed_node_group : {})
eks_managed_node_groups = merge(local.main_managed_node_group, var.enable_x86_workers ? local.x86_managed_node_group : {}, var.enable_arm_workers ? local.arm_managed_node_group : {})
}

provider "aws" {
Expand Down
6 changes: 6 additions & 0 deletions terraform/deployments/cluster-infrastructure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ variable "enable_x86_workers" {
default = true
}

variable "main_workers_instance_types" {
type = list(string)
description = "TEMPORARY - List of instance types for the managed node group, in order of preference. The second and subsequent preferences are only relevant when using spot instances."
default = [ "m6i.4xlarge", "m6a.4xlarge", "m6i.2xlarge", "m6a.2xlarge" ]
}

variable "x86_workers_instance_types" {
type = list(string)
description = "List of instance types for the managed node group, in order of preference. The second and subsequent preferences are only relevant when using spot instances."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ module "variable-set-integration" {
enable_arm_workers = true
enable_x86_workers = true

main_workers_instance_types = ["m6i.4xlarge", "m6a.4xlarge", "m6i.2xlarge", "m6a.2xlarge"]

publishing_service_domain = "integration.publishing.service.gov.uk"

frontend_memcached_node_type = "cache.t4g.micro"
Expand Down
2 changes: 2 additions & 0 deletions terraform/deployments/tfc-configuration/variables-staging.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ module "variable-set-staging" {
enable_arm_workers = true
enable_x86_workers = true

main_workers_instance_types = ["m6i.4xlarge", "m6a.4xlarge", "m6i.2xlarge", "m6a.2xlarge"]

publishing_service_domain = "staging.publishing.service.gov.uk"

frontend_memcached_node_type = "cache.t4g.medium"
Expand Down

0 comments on commit e7af5ae

Please sign in to comment.