Skip to content

Commit

Permalink
Add Metrics Server support, enable on non-prod...
Browse files Browse the repository at this point in the history
...so that we can test it first.
  • Loading branch information
dj-maisy committed Jan 24, 2025
1 parent a9487bc commit 0b2ff1c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
18 changes: 13 additions & 5 deletions terraform/deployments/cluster-infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ locals {
secrets_prefix = "govuk"
monitoring_namespace = "monitoring"

default_cluster_addons = {
coredns = { most_recent = true }
kube-proxy = { most_recent = true }
vpc-cni = { most_recent = true }
}

metrics_server_addon = {
metrics-server = { most_recent = true }
}

enabled_cluster_addons = merge(local.default_cluster_addons, var.enable_metrics_server ? local.metrics_server_addon : {})

main_managed_node_group = {
main = {
name_prefix = var.cluster_name
Expand Down Expand Up @@ -187,11 +199,7 @@ module "eks" {
subnet_ids = [for s in aws_subnet.eks_control_plane : s.id]
vpc_id = data.terraform_remote_state.infra_vpc.outputs.vpc_id

cluster_addons = {
coredns = { most_recent = true }
kube-proxy = { most_recent = true }
vpc-cni = { most_recent = true }
}
cluster_addons = local.enabled_cluster_addons

cluster_endpoint_public_access = true
cloudwatch_log_group_retention_in_days = var.cluster_log_retention_in_days
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 @@ -51,6 +51,12 @@ variable "force_destroy" {
default = false
}

variable "enable_metrics_server" {
type = bool
description = "Enable the Metrics Server EKS Add-on. For Pod Metrics and HPA support."
default = false
}

variable "enable_arm_workers" {
type = bool
description = "Whether to enable the ARM/Graviton-based Managed Node Group"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ module "variable-set-integration" {
govuk_environment = "integration"
force_destroy = true

enable_metrics_server = true

enable_arm_workers = true
enable_main_workers = false
enable_x86_workers = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ module "variable-set-production" {

govuk_environment = "production"

enable_metrics_server = false

enable_arm_workers = false
enable_main_workers = true
enable_x86_workers = false
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 @@ -55,6 +55,8 @@ module "variable-set-staging" {

govuk_environment = "staging"

enable_metrics_server = true

enable_arm_workers = true
enable_main_workers = false
enable_x86_workers = true
Expand Down

0 comments on commit 0b2ff1c

Please sign in to comment.