Skip to content

[terraform/aws] Enable EKS node auto repair on the managed node group - #1778

Open
StevenPG wants to merge 4 commits into
interuss:masterfrom
StevenPG:stevenpg-aws-dss-reliability-review
Open

StevenPG wants to merge 4 commits into
interuss:masterfrom
StevenPG:stevenpg-aws-dss-reliability-review

Conversation

@StevenPG

@StevenPG StevenPG commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1782.

Changes

Enable EKS node auto repair on the managed node group (node_repair_config), controlled by a new aws_enable_node_auto_repair variable that defaults to true, matching GKE's default behavior. Unhealthy nodes (for example stuck in NotReady) are drained and replaced automatically. Applying this to an existing cluster updates the node group in place and does not replace nodes. Set aws_enable_node_auto_repair = false to keep the previous behavior.

Testing

  • terraform fmt -recursive -check deploy
  • terraform validate on terraform-aws-dss
  • generate_terraform_variables.sh --lint

Applied to a live cluster

Applied to an existing EKS 1.34 deployment (3 nodes, CockroachDB, us-west-1) that was created with an older version of this module. The same apply also changed aws_instance_type, so the node group was replaced rather than updated in place.

  • The node group with node_repair_config enabled was created successfully, and the old group was drained and deleted. With CockroachDB set to hard pod anti-affinity through a Helm override, the pods moved one at a time and CockroachDB kept 3 live nodes and 0 unavailable ranges.
  • aws eks describe-nodegroup reports nodeRepairConfig.enabled: true.
  • A follow-up terraform plan shows no changes.

@StevenPG StevenPG changed the title [terraform/aws] Improve EKS node reliability: node auto repair and metrics-server [terraform/aws] Improve EKS node reliability: node auto repair, eks node monitoring agent and metrics-server Oct 13, 2026
@barroco

barroco commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Thank you very much @StevenPG . May I kindly ask you to split the PR so it can be reviewed and merged indenpendently ?
If you wish to keep a logical grouping between them to share the context, feel free to open an issue and reference it the PRs descriptions.

@StevenPG
StevenPG force-pushed the stevenpg-aws-dss-reliability-review branch from cd75487 to 2fed96d Compare October 14, 2026 14:46
@StevenPG StevenPG changed the title [terraform/aws] Improve EKS node reliability: node auto repair, eks node monitoring agent and metrics-server [terraform/aws] Enable EKS node auto repair on the managed node group Oct 14, 2026
Worker nodes of the EKS managed node group are only replaced by the
Auto Scaling group when the EC2 status checks fail. A node whose
kubelet stops reporting (e.g. due to memory exhaustion) while the
instance itself stays healthy remains `NotReady` indefinitely.

This is especially harmful to the datastore: a CockroachDB or Yugabyte
pod cannot safely be rescheduled on a node already hosting another
datastore replica, so the replica of an unhealthy node stays down
until the node recovers by itself.

GKE node pools enable auto repair by default. This change aligns the
AWS deployment by enabling EKS node auto repair through
`node_repair_config` on `aws_eks_node_group`.

The behavior is controlled by a new variable,
`aws_enable_node_auto_repair` (default `true`), exposed by the
`terraform-aws-dss` module. The change is applied in place on existing
node groups and does not replace nodes.

Part of interuss#1782.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@StevenPG
StevenPG force-pushed the stevenpg-aws-dss-reliability-review branch from 2fed96d to 48f47e7 Compare October 14, 2026 14:55
}

node_repair_config {
enabled = var.aws_enable_node_auto_repair

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should limit auto repair to one node at a time with max_parallel_nodes_repaired_count = 1, so that a majority of the datastore nodes stays available during repairs.
This requires AWS provider 6.20.0 or later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this is commit: 5da6637

I tried to keep the configuration open such that the two options are 1 or null, that way the onus isn't on the deployer to make a determination on the ideal value, but users who need the prior no-repair implementation can opt-out.

Example: `true`
EOT

default = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide a reference to check GKE feature parity ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that for the google terraform provider, if a section is not provided, the default values are used.

I looked through the GKE documentation and I believe I understood it well enough to make that claim, but let me know if I'm off base!

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#auto_repair-1

[auto_repair](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#auto_repair-1) - (Optional) Whether the nodes will be automatically repaired. Enabled by default.

The GKE configuration doesn't include a management block:

resource "google_container_node_pool" "dss_pool" {
name = "dss-pool"
location = var.google_zone
cluster = google_container_cluster.kubernetes_cluster.name
node_count = var.node_count
node_config {
machine_type = var.google_machine_type
disk_size_gb = 25 # Kubernetes PVC will create distinct disks.
# TODO: Use non-default service account with IAM roles
oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform"
]
metadata = {
"disable-legacy-endpoints" = true
}
}
lifecycle {
create_before_destroy = true
}
}

StevenPG and others added 2 commits October 21, 2026 15:32
Set max_parallel_nodes_repaired_count = 1 so that a majority of the
datastore nodes stays available during repairs. This requires AWS
provider 6.20.0 or later. Also reference the GKE auto repair default
in the variable description.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… agent add-on

Resolve merge conflicts with interuss#1784, which added the adjacent
aws_enable_node_monitoring_agent variable. Both variables are kept in
variables.py, terraform-aws-dss/main.tf and NEXT_RELEASE_NOTES.md, and
the *.gen.tf / TFVARS.gen.md files were regenerated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants