Skip to content

Switch regional and management clusters from EKS Auto Mode to OSS Karpenter#674

Open
theautoroboto wants to merge 14 commits into
openshift-online:mainfrom
theautoroboto:remove-auto-mode
Open

Switch regional and management clusters from EKS Auto Mode to OSS Karpenter#674
theautoroboto wants to merge 14 commits into
openshift-online:mainfrom
theautoroboto:remove-auto-mode

Conversation

@theautoroboto

@theautoroboto theautoroboto commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds an `enable_karpenter` feature flag (default: `true`) to the `eks-cluster` Terraform module that switches from EKS Auto Mode to self-managed OSS Karpenter with a CriticalAddonsOnly bootstrap node group
  • Installs Karpenter via Helm in the ECS bootstrap script before seeding EC2NodeClass/NodePool; pre-warms one node before ArgoCD install to surface EC2 API rate limiting failures early (as ECS task failures with automatic retry) rather than as silent post-ArgoCD cascades
  • Adds AWS Load Balancer Controller as a standalone ArgoCD app + Terraform IAM module — EKS Auto Mode shipped LBC built-in; OSS Karpenter does not
  • Guards HyperShift external-dns install flags behind a domain conditional to prevent empty-domain shell parsing bugs; adds a CRD readiness wait so the install job blocks until Prometheus Operator CRDs are registered before applying ServiceMonitor/PrometheusRule resources
  • Adds `ignoreDifferences` to the ApplicationSet for LBC webhook `caBundle`, TLS secret, and TargetGroupBinding `status` fields to prevent controller-managed fields from causing OutOfSync

Context

EKS Auto Mode is not available in GovCloud (us-gov-west-1, us-gov-east-1), which are required for FedRAMP Moderate delivery. This PR migrates both RC and MC cluster types to OSS Karpenter so the same codebase works across commercial and GovCloud regions.

Integration note: This cannot be applied to an existing Auto Mode cluster via `terraform apply`. The existing integration cluster must be decommissioned and a new one provisioned with `enable_karpenter=true` from the start. See ROSAENG-61244 for the full root cause analysis and conversion rationale.

What's included

Commit What
`d0c8a894` Core migration: OSS Karpenter infrastructure (bootstrap node group, IRSA, SQS, EBS CSI, OIDC, NodePool/EC2NodeClass ArgoCD templates), AWS Load Balancer Controller (ArgoCD Helm wrapper + Terraform IAM), TargetGroupBinding API group fix, ApplicationSet ignoreDifferences, docs
`d2df54c0` HyperShift: guard external-dns flags when domain is not configured; add Prometheus Operator CRD readiness wait to prevent install job race
`1a0fabbe` Add RC and MC Kubernetes validation scripts with per-app ArgoCD diagnostics

Test plan

  • Ephemeral RC: ./scripts/validate-rc-k8s.sh21 PASS, 0 FAIL
  • Ephemeral MC: ./scripts/validate-mc-k8s.sh8 PASS, 0 FAIL
  • All 25 RC ArgoCD applications Synced/Healthy
  • All 13 MC ArgoCD applications Synced/Healthy (including `hypershift` Synced/Healthy after CRD race fix)
  • Karpenter-provisioned nodes present on both RC (6 nodes) and MC (3 nodes)
  • EC2NodeClass `fips` Ready=True; NodePool Ready=True on RC
  • `kubectl get crd targetgroupbindings.elbv2.k8s.aws` present (LBC CRD installed)
  • `platform-api` pods Running; HyperShift operator Running (2 pods)
  • Bootstrap nodes retain `CriticalAddonsOnly=true:NoSchedule` taint
  • `make pre-push` passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added OSS Karpenter support with updated bootstrap provisioning and node class/node pool wiring.
    • Improved Argo CD behavior to reduce false OutOfSync alerts by ignoring AWS Load Balancer Controller–driven changes.
    • Added Kubernetes health-check scripts for management and regional clusters.
  • Bug Fixes
    • Updated Kubernetes manifests and add-ons to use current AWS/Karpenter and ELB TargetGroupBinding API versions.
    • Improved bootstrap reliability by waiting for core addons, prewarming Karpenter, and adding Argo CD recovery; also adjusted StorageClass configuration.

@openshift-ci

openshift-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign iamkirkbater for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR migrates the cluster stack toward OSS Karpenter, adds bootstrap and validation logic for the new provisioning flow, updates Argo CD and TargetGroupBinding handling, and refreshes related documentation and maintenance scripts.

Changes

Karpenter platform migration

Layer / File(s) Summary
Module inputs and cluster shape
terraform/modules/eks-cluster/{variables.tf,versions.tf,data.tf,locals.tf,outputs.tf}, terraform/modules/ecs-bootstrap/{variables.tf,README.md}, argocd/config/{management-cluster,regional-cluster}/eks-nodepool/{templates/00-nodeclass.yaml,templates/10-nodepool.yaml,values.yaml}, Makefile
Adds Karpenter-facing inputs, outputs, provider requirements, OIDC helpers, and Helm values; replaces NodeClass with EC2NodeClass; and updates lint stubs for global.cluster_name.
Karpenter IAM and cluster resources
terraform/modules/eks-cluster/{iam.tf,main.tf}, terraform/config/{management-cluster,regional-cluster}/main.tf, terraform/modules/hyperfleet-infrastructure/amazonmq.tf
Conditions Auto Mode resources on enable_karpenter, adds Karpenter node/controller IAM, interruption queue handling, bootstrap node group, addon dependencies, and related module wiring.
Bootstrap orchestration
terraform/modules/ecs-bootstrap/main.tf, scripts/buildspec/register.sh, terraform/modules/ecs-bootstrap/README.md
Waits for addons, installs and prewarms Karpenter, recovers Argo CD releases, and adjusts readiness polling and bootstrap documentation.
Module and design docs
docs/README.md, docs/design/{fips-eks-compute.md,fully-private-eks-bootstrap.md,logging-platform.md,thanos-metrics-infrastructure.md,zoa-trusted-actions.md,gitops-cluster-configuration.md,rate-limiting-architecture.md}, terraform/modules/{eks-cluster,ecs-bootstrap}/README.md
Updates design and module documentation to describe the Karpenter-based flow and related cluster assumptions.
Cluster health validation scripts
scripts/validate-mc-k8s.sh, scripts/validate-rc-k8s.sh
Adds new scripts validating nodes, Karpenter, HyperShift, core addons, platform services, and Argo CD with PASS/FAIL/WARN reporting.

Estimated code review effort: 5 (Critical) | ~120 minutes

Argo CD and Load Balancer Controller wiring

Layer / File(s) Summary
Argo CD diff suppression
config/templates/argocd-bootstrap/applicationset.yaml.j2, deploy/{ephemeral,integration}/us-east-1/argocd-bootstrap-*/applicationset.yaml
Enables RespectIgnoreDifferences, ignores LBC-managed drift, and passes clusterName into Helm values.
TargetGroupBinding and storage APIs
argocd/config/regional-cluster/{platform-api,loki,thanos}/templates/targetgroupbinding.yaml, argocd/config/shared/storageclass/templates/gp3.yaml
Moves TargetGroupBinding manifests to elbv2.k8s.aws/v1beta1 and switches the gp3 StorageClass provisioner.
Load balancer controller module wiring
terraform/config/regional-cluster/main.tf, docs/README.md
Adds the aws_load_balancer_controller Terraform module and documents it in the docs index.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Argo CD bootstrap node toleration

Layer / File(s) Summary
CriticalAddonsOnly tolerations
argocd/config/shared/argocd/values.yaml
Adds CriticalAddonsOnly tolerations to global, component, and redis-ha values.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: migrating regional and management clusters from EKS Auto Mode to OSS Karpenter.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@theautoroboto theautoroboto added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jul 6, 2026
@theautoroboto

Copy link
Copy Markdown
Contributor Author

/test on-demand-e2e

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 6

🧹 Nitpick comments (2)
terraform/modules/aws-load-balancer-controller/iam.tf (1)

34-317: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Broad Resource: "*" and unscoped read/create actions match the documented upstream policy.

The remaining Checkov findings (CKV_AWS_355/CKV_AWS_290) on Describe*/Read actions and iam:CreateServiceLinkedRole reflect AWS's own recommended AWS Load Balancer Controller policy, which inherently requires broad EC2/ELB describe permissions and Resource: "*" for actions that don't support resource-level ARNs. This is expected and consistent with the upstream reference; consider adding inline #checkov:skip=CKV_AWS_355 / CKV_AWS_290 comments with justification so future scans don't need re-triage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@terraform/modules/aws-load-balancer-controller/iam.tf` around lines 34 - 317,
The IAM policy in aws_lbc intentionally uses broad read and service-linked-role
permissions that Checkov flags, so the fix is to document the exception rather
than changing the policy. Add inline Checkov skip comments for CKV_AWS_355 and
CKV_AWS_290 on the relevant statements in aws_iam_role_policy.aws_lbc,
especially the Describe*/read blocks and the iam:CreateServiceLinkedRole
statement, with a brief justification that this matches the upstream AWS Load
Balancer Controller policy and requires Resource = "*".

Source: Linters/SAST tools

argocd/config/regional-cluster/aws-load-balancer-controller/values.yaml (1)

12-14: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Consider dropping all Linux capabilities.

securityContext sets allowPrivilegeEscalation: false and readOnlyRootFilesystem: true but doesn't drop capabilities. The upstream chart ships this commented out by default too, so this matches defaults, but explicitly adding capabilities.drop: ["ALL"] would further harden the pod per common CIS benchmarks.

🛡️ Suggested hardening
   securityContext:
     allowPrivilegeEscalation: false
     readOnlyRootFilesystem: true
+    capabilities:
+      drop:
+        - ALL
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@argocd/config/regional-cluster/aws-load-balancer-controller/values.yaml`
around lines 12 - 14, The pod securityContext is missing an explicit capability
drop, so harden the AWS Load Balancer Controller values by adding a
capabilities.drop entry that removes all Linux capabilities alongside the
existing allowPrivilegeEscalation and readOnlyRootFilesystem settings. Update
the securityContext block in the regional-cluster/aws-load-balancer-controller
values to include the capabilities field so the chart deployment uses a more
restrictive runtime profile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@argocd/config/management-cluster/eks-nodepool/templates/00-nodeclass.yaml`:
- Around line 1-18: The EC2NodeClass named fips is still selecting a standard
Bottlerocket AMI via the amiSelectorTerms alias, so update the node class to use
an explicit FIPS AMI selection method instead of the generic alias. Adjust the
EC2NodeClass template in 00-nodeclass.yaml to reference a FIPS-compliant
Bottlerocket image using tags, an SSM parameter, or a specific AMI ID while
keeping the existing cluster-specific role and selector logic intact.

In `@argocd/config/regional-cluster/eks-nodepool/templates/00-nodeclass.yaml`:
- Around line 1-18: The EC2NodeClass named fips is still selecting the default
Bottlerocket image via amiSelectorTerms, so update that selector to point to the
region-specific RHEL FIPS AMI instead. Adjust the amiSelectorTerms block in the
node class template so the fips NodeClass resolves the intended FIPS-compliant
image, keeping the existing clusterName-based role and selectors unchanged.

In `@terraform/modules/aws-load-balancer-controller/iam.tf`:
- Around line 152-206: The EC2 tag-related IAM conditions in the policy block
need to match the reference policy more closely. Update the EC2CreateTags
statement in the aws-load-balancer-controller IAM policy to guard on
aws:RequestTag/elbv2.k8s.aws/cluster instead of aws:RequestedRegion, and change
the EC2MutateTags Null condition for aws:RequestTag/elbv2.k8s.aws/cluster to
"true" so tag mutations are permitted as intended. Use the existing
EC2CreateTags and EC2MutateTags entries in iam.tf to make these adjustments.

In `@terraform/modules/ecs-bootstrap/main.tf`:
- Around line 165-182: The heredoc used in the bootstrap script is being
indented with spaces, so the current `kubectl apply -f - <<-PREWARM_EOF` form
will not terminate correctly. Update the heredoc in the bootstrap/user-data
block to use a quoted heredoc or remove the indentation so the `PREWARM_EOF`
delimiter is left-aligned, and keep this change near the `kubectl apply` prewarm
pod manifest.

In `@terraform/modules/eks-cluster/iam.tf`:
- Around line 194-266: The EC2Fleet and IAMInstanceProfile statements in the
Karpenter controller policy are still too broad because they allow mutating EC2
and instance profile APIs on wildcard resources. Update the IAM policy in the
EKS cluster IAM configuration so these actions are restricted using the same
tag-based conditions used by the EC2NodeClass and NodePool, while keeping the
Describe* permissions unchanged and leaving iam:PassRole scoped to
aws_iam_role.karpenter_node[0].arn.

In `@terraform/modules/eks-cluster/main.tf`:
- Around line 197-224: The karpenter bootstrap node group can be created before
the VPC CNI addon exists, which can prevent nodes from joining in time. Update
the aws_eks_node_group "karpenter_bootstrap" resource to explicitly wait on
aws_eks_addon.vpc_cni by adding it to depends_on, and keep kube-proxy out of the
gate so only the required addon blocks this bootstrap path.

---

Nitpick comments:
In `@argocd/config/regional-cluster/aws-load-balancer-controller/values.yaml`:
- Around line 12-14: The pod securityContext is missing an explicit capability
drop, so harden the AWS Load Balancer Controller values by adding a
capabilities.drop entry that removes all Linux capabilities alongside the
existing allowPrivilegeEscalation and readOnlyRootFilesystem settings. Update
the securityContext block in the regional-cluster/aws-load-balancer-controller
values to include the capabilities field so the chart deployment uses a more
restrictive runtime profile.

In `@terraform/modules/aws-load-balancer-controller/iam.tf`:
- Around line 34-317: The IAM policy in aws_lbc intentionally uses broad read
and service-linked-role permissions that Checkov flags, so the fix is to
document the exception rather than changing the policy. Add inline Checkov skip
comments for CKV_AWS_355 and CKV_AWS_290 on the relevant statements in
aws_iam_role_policy.aws_lbc, especially the Describe*/read blocks and the
iam:CreateServiceLinkedRole statement, with a brief justification that this
matches the upstream AWS Load Balancer Controller policy and requires Resource =
"*".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6bfad381-32e1-427b-82fb-8a331ff1d03c

📥 Commits

Reviewing files that changed from the base of the PR and between 942b09d and 0def15f.

📒 Files selected for processing (38)
  • Makefile
  • argocd/config/management-cluster/eks-nodepool/templates/00-nodeclass.yaml
  • argocd/config/management-cluster/eks-nodepool/templates/10-nodepool.yaml
  • argocd/config/management-cluster/eks-nodepool/values.yaml
  • argocd/config/management-cluster/hypershift/templates/05-job.yaml
  • argocd/config/regional-cluster/aws-load-balancer-controller/Chart.yaml
  • argocd/config/regional-cluster/aws-load-balancer-controller/values.yaml
  • argocd/config/regional-cluster/eks-nodepool/templates/00-nodeclass.yaml
  • argocd/config/regional-cluster/eks-nodepool/templates/10-nodepool.yaml
  • argocd/config/regional-cluster/eks-nodepool/values.yaml
  • argocd/config/regional-cluster/platform-api/templates/targetgroupbinding.yaml
  • argocd/config/shared/argocd/values.yaml
  • argocd/config/shared/storageclass/templates/gp3.yaml
  • config/templates/argocd-bootstrap/applicationset.yaml.j2
  • deploy/ephemeral/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/ephemeral/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • docs/design/gitops-cluster-configuration.md
  • docs/design/karpenter-node-provisioning.md
  • docs/design/rate-limiting-architecture.md
  • scripts/buildspec/register.sh
  • terraform/config/management-cluster/main.tf
  • terraform/config/regional-cluster/main.tf
  • terraform/modules/aws-load-balancer-controller/iam.tf
  • terraform/modules/aws-load-balancer-controller/main.tf
  • terraform/modules/aws-load-balancer-controller/outputs.tf
  • terraform/modules/aws-load-balancer-controller/variables.tf
  • terraform/modules/aws-load-balancer-controller/versions.tf
  • terraform/modules/ecs-bootstrap/main.tf
  • terraform/modules/ecs-bootstrap/variables.tf
  • terraform/modules/eks-cluster/data.tf
  • terraform/modules/eks-cluster/iam.tf
  • terraform/modules/eks-cluster/locals.tf
  • terraform/modules/eks-cluster/main.tf
  • terraform/modules/eks-cluster/outputs.tf
  • terraform/modules/eks-cluster/variables.tf
  • terraform/modules/eks-cluster/versions.tf

Comment thread terraform/modules/aws-load-balancer-controller/iam.tf
Comment thread terraform/modules/ecs-bootstrap/main.tf Outdated
Comment thread terraform/modules/eks-cluster/iam.tf
Comment thread terraform/modules/eks-cluster/main.tf
@theautoroboto

Copy link
Copy Markdown
Contributor Author

/test on-demand-e2e

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
terraform/modules/eks-cluster/variables.tf (1)

84-88: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Temporary version pin lacks a tracking marker.

Per the commit history, this default was reverted from 1.13.0 to 1.5.0 to isolate a prewarm/IAM issue, with a planned re-bump once root-caused. Since there's no TODO/comment here, this temporary pin risks being forgotten.

📝 Suggested tracking comment
 variable "karpenter_version" {
   description = "OSS Karpenter version string (e.g. \"1.5.0\"). Used to select the Helm chart version when deploying via ArgoCD."
   type        = string
+  # TODO: temporarily reverted from 1.13.0 to isolate prewarm/IAM failure; re-bump once root cause is confirmed.
   default     = "1.5.0"
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@terraform/modules/eks-cluster/variables.tf` around lines 84 - 88, The
karpenter_version default in variable karpenter_version is a temporary rollback
and needs a tracking marker so it is not forgotten. Add a clear TODO/comment
рядом with the default value noting that it is intentionally pinned for the
prewarm/IAM investigation and should be re-bumped once the issue is resolved,
keeping the comment attached to the karpenter_version variable definition.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@terraform/modules/eks-cluster/variables.tf`:
- Around line 84-88: The karpenter_version default in variable karpenter_version
is a temporary rollback and needs a tracking marker so it is not forgotten. Add
a clear TODO/comment рядом with the default value noting that it is
intentionally pinned for the prewarm/IAM investigation and should be re-bumped
once the issue is resolved, keeping the comment attached to the
karpenter_version variable definition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1452293d-994b-47db-9261-bb6eae2019cb

📥 Commits

Reviewing files that changed from the base of the PR and between 911067a and f914ebc.

📒 Files selected for processing (1)
  • terraform/modules/eks-cluster/variables.tf

@theautoroboto theautoroboto force-pushed the remove-auto-mode branch 5 times, most recently from 692aae2 to f1eeb2e Compare July 7, 2026 19:31

@coderabbitai coderabbitai Bot left a comment

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.

♻️ Duplicate comments (2)
argocd/config/management-cluster/eks-nodepool/templates/00-nodeclass.yaml (1)

7-8: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

FIPS NodeClass still selects a non-FIPS Bottlerocket AMI.

The fips EC2NodeClass resolves - alias: bottlerocket@latest to the standard Bottlerocket family. If this node class must remain FIPS-compliant, select the FIPS AMI explicitly (tags, SSM parameter, or AMI ID) rather than the generic alias.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@argocd/config/management-cluster/eks-nodepool/templates/00-nodeclass.yaml`
around lines 7 - 8, The EC2NodeClass currently uses the generic Bottlerocket
alias in amiSelectorTerms, which resolves to a non-FIPS AMI; update the fips
node class definition to select a FIPS-compliant Bottlerocket image explicitly
instead. Use the existing EC2NodeClass template and replace the alias-based
selection with a FIPS-specific selector such as a matching tag, SSM parameter,
or fixed AMI ID so the class consistently resolves to the intended FIPS image.
argocd/config/regional-cluster/eks-nodepool/templates/00-nodeclass.yaml (1)

7-8: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

FIPS NodeClass still selects the default Bottlerocket image.

- alias: bottlerocket@latest points to the standard Bottlerocket AMI, so the fips NodeClass launches non-FIPS nodes. Point amiSelectorTerms at the intended FIPS-compliant image (tags, SSM parameter, or AMI ID) to match the regional cluster's FIPS design.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@argocd/config/regional-cluster/eks-nodepool/templates/00-nodeclass.yaml`
around lines 7 - 8, The FIPS NodeClass is still using the default Bottlerocket
AMI selector, so update the amiSelectorTerms in the NodeClass template to point
to the FIPS-compliant image instead of alias: bottlerocket@latest. Use the
existing NodeClass/amiSelectorTerms block to switch to the correct FIPS AMI
source, such as the intended tags, SSM parameter, or AMI ID, so the fips
nodepool launches compliant nodes.
🧹 Nitpick comments (1)
terraform/config/management-cluster/main.tf (1)

70-72: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Simplify null-to-empty-string fallback with coalesce().

The ternary pattern can be replaced with the built-in coalesce() function for conciseness, since coalesce takes any number of arguments and returns the first one that isn't null or an empty string.

♻️ Proposed refactor
-  karpenter_controller_role_arn = module.management_cluster.karpenter_controller_role_arn != null ? module.management_cluster.karpenter_controller_role_arn : ""
-  karpenter_queue_url           = module.management_cluster.karpenter_queue_url != null ? module.management_cluster.karpenter_queue_url : ""
+  karpenter_controller_role_arn = coalesce(module.management_cluster.karpenter_controller_role_arn, "")
+  karpenter_queue_url           = coalesce(module.management_cluster.karpenter_queue_url, "")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@terraform/config/management-cluster/main.tf` around lines 70 - 72, Simplify
the null-to-empty-string fallback in the management cluster configuration by
replacing the explicit ternary checks on
module.management_cluster.karpenter_controller_role_arn and
module.management_cluster.karpenter_queue_url with coalesce(), so the
locals/inputs use the first non-null, non-empty value directly. Update the
assignments in the terraform main configuration where these karpenter_* values
are set, keeping the same empty-string fallback behavior but using the built-in
function for clarity and consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@argocd/config/management-cluster/eks-nodepool/templates/00-nodeclass.yaml`:
- Around line 7-8: The EC2NodeClass currently uses the generic Bottlerocket
alias in amiSelectorTerms, which resolves to a non-FIPS AMI; update the fips
node class definition to select a FIPS-compliant Bottlerocket image explicitly
instead. Use the existing EC2NodeClass template and replace the alias-based
selection with a FIPS-specific selector such as a matching tag, SSM parameter,
or fixed AMI ID so the class consistently resolves to the intended FIPS image.

In `@argocd/config/regional-cluster/eks-nodepool/templates/00-nodeclass.yaml`:
- Around line 7-8: The FIPS NodeClass is still using the default Bottlerocket
AMI selector, so update the amiSelectorTerms in the NodeClass template to point
to the FIPS-compliant image instead of alias: bottlerocket@latest. Use the
existing NodeClass/amiSelectorTerms block to switch to the correct FIPS AMI
source, such as the intended tags, SSM parameter, or AMI ID, so the fips
nodepool launches compliant nodes.

---

Nitpick comments:
In `@terraform/config/management-cluster/main.tf`:
- Around line 70-72: Simplify the null-to-empty-string fallback in the
management cluster configuration by replacing the explicit ternary checks on
module.management_cluster.karpenter_controller_role_arn and
module.management_cluster.karpenter_queue_url with coalesce(), so the
locals/inputs use the first non-null, non-empty value directly. Update the
assignments in the terraform main configuration where these karpenter_* values
are set, keeping the same empty-string fallback behavior but using the built-in
function for clarity and consistency.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 162aa7e5-3550-450e-b58d-0b15e9fe0e15

📥 Commits

Reviewing files that changed from the base of the PR and between 692aae2 and f1eeb2e.

📒 Files selected for processing (37)
  • Makefile
  • argocd/config/management-cluster/eks-nodepool/templates/00-nodeclass.yaml
  • argocd/config/management-cluster/eks-nodepool/templates/10-nodepool.yaml
  • argocd/config/management-cluster/eks-nodepool/values.yaml
  • argocd/config/management-cluster/hypershift/templates/05-job.yaml
  • argocd/config/regional-cluster/aws-load-balancer-controller/Chart.yaml
  • argocd/config/regional-cluster/aws-load-balancer-controller/values.yaml
  • argocd/config/regional-cluster/eks-nodepool/templates/00-nodeclass.yaml
  • argocd/config/regional-cluster/eks-nodepool/templates/10-nodepool.yaml
  • argocd/config/regional-cluster/eks-nodepool/values.yaml
  • argocd/config/regional-cluster/platform-api/templates/targetgroupbinding.yaml
  • argocd/config/shared/argocd/values.yaml
  • argocd/config/shared/storageclass/templates/gp3.yaml
  • config/templates/argocd-bootstrap/applicationset.yaml.j2
  • deploy/ephemeral/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/ephemeral/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • docs/design/gitops-cluster-configuration.md
  • docs/design/rate-limiting-architecture.md
  • scripts/buildspec/register.sh
  • terraform/config/management-cluster/main.tf
  • terraform/config/regional-cluster/main.tf
  • terraform/modules/aws-load-balancer-controller/iam.tf
  • terraform/modules/aws-load-balancer-controller/main.tf
  • terraform/modules/aws-load-balancer-controller/outputs.tf
  • terraform/modules/aws-load-balancer-controller/variables.tf
  • terraform/modules/aws-load-balancer-controller/versions.tf
  • terraform/modules/ecs-bootstrap/main.tf
  • terraform/modules/ecs-bootstrap/variables.tf
  • terraform/modules/eks-cluster/data.tf
  • terraform/modules/eks-cluster/iam.tf
  • terraform/modules/eks-cluster/locals.tf
  • terraform/modules/eks-cluster/main.tf
  • terraform/modules/eks-cluster/outputs.tf
  • terraform/modules/eks-cluster/variables.tf
  • terraform/modules/eks-cluster/versions.tf
✅ Files skipped from review due to trivial changes (6)
  • argocd/config/regional-cluster/aws-load-balancer-controller/Chart.yaml
  • deploy/ephemeral/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • terraform/modules/aws-load-balancer-controller/main.tf
  • terraform/modules/aws-load-balancer-controller/versions.tf
  • docs/design/rate-limiting-architecture.md
  • docs/design/gitops-cluster-configuration.md
🚧 Files skipped from review as they are similar to previous changes (27)
  • config/templates/argocd-bootstrap/applicationset.yaml.j2
  • deploy/integration/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • argocd/config/regional-cluster/platform-api/templates/targetgroupbinding.yaml
  • deploy/ephemeral/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • terraform/modules/eks-cluster/locals.tf
  • argocd/config/management-cluster/eks-nodepool/values.yaml
  • terraform/modules/aws-load-balancer-controller/variables.tf
  • Makefile
  • argocd/config/shared/storageclass/templates/gp3.yaml
  • terraform/modules/aws-load-balancer-controller/outputs.tf
  • terraform/modules/eks-cluster/data.tf
  • terraform/modules/eks-cluster/versions.tf
  • terraform/modules/ecs-bootstrap/variables.tf
  • argocd/config/regional-cluster/eks-nodepool/values.yaml
  • argocd/config/management-cluster/eks-nodepool/templates/10-nodepool.yaml
  • argocd/config/management-cluster/hypershift/templates/05-job.yaml
  • terraform/modules/eks-cluster/variables.tf
  • argocd/config/shared/argocd/values.yaml
  • argocd/config/regional-cluster/eks-nodepool/templates/10-nodepool.yaml
  • terraform/modules/eks-cluster/outputs.tf
  • terraform/config/regional-cluster/main.tf
  • argocd/config/regional-cluster/aws-load-balancer-controller/values.yaml
  • terraform/modules/aws-load-balancer-controller/iam.tf
  • terraform/modules/eks-cluster/main.tf
  • terraform/modules/eks-cluster/iam.tf
  • terraform/modules/ecs-bootstrap/main.tf

@theautoroboto

Copy link
Copy Markdown
Contributor Author

/test on-demand-e2e

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/design/karpenter-node-provisioning.md`:
- Around line 140-150: The implementation note in the
karpenter-node-provisioning design doc is duplicated verbatim, which creates
markdownlint MD028 noise and can drift over time. Remove one of the repeated
blockquote paragraphs so only a single implementation note remains, keeping the
existing wording tied to the EC2NodeClass, amiSelectorTerms, amiFamily, and
nodeadm guidance.

In `@terraform/modules/ecs-bootstrap/README.md`:
- Line 67: Clarify the management_clusters README entry by replacing the vague
“Comma-separated colon-delimited” description with an explicit grammar and
example such as mc01:123456789012,mc02:210987654321. Update the documentation
text in the management_clusters table so readers can clearly see that entries
are comma-separated pairs using a colon between cluster name and account ID.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ebd3dff6-2373-4d63-b0a4-8b5b44e64dd6

📥 Commits

Reviewing files that changed from the base of the PR and between f1eeb2e and 423b946.

📒 Files selected for processing (6)
  • docs/README.md
  • docs/design/fips-eks-compute.md
  • docs/design/karpenter-node-provisioning.md
  • terraform/modules/aws-load-balancer-controller/README.md
  • terraform/modules/ecs-bootstrap/README.md
  • terraform/modules/eks-cluster/README.md
✅ Files skipped from review due to trivial changes (3)
  • docs/design/fips-eks-compute.md
  • terraform/modules/aws-load-balancer-controller/README.md
  • docs/README.md

Comment thread docs/design/karpenter-node-provisioning.md Outdated
Comment thread terraform/modules/ecs-bootstrap/README.md Outdated
@theautoroboto theautoroboto force-pushed the remove-auto-mode branch 4 times, most recently from 60a6fbf to 3f58005 Compare July 8, 2026 20:08

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/buildspec/register.sh (1)

76-96: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Handle curl failures locally instead of disabling errexit.

set +e makes every command in the polling block non-fatal. Keep errexit enabled and handle only the expected curl failure path.

As per path instructions, scripts/**: “Review shell scripts for command injection vulnerabilities and proper error handling.”

Proposed fix
-set +e
 MAX_RETRIES=80
 RETRY_DELAY=30
 RETRY_COUNT=0
 LIVE_OK=false
@@
-    HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
+    if ! HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
         --connect-timeout 10 \
         --max-time 30 \
         --aws-sigv4 "aws:amz:${TARGET_REGION}:execute-api" \
         --user "${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}" \
         "${SECURITY_TOKEN_HEADER[@]}" \
-        -X GET "$API_GATEWAY_URL/api/v0/live")
+        -X GET "$API_GATEWAY_URL/api/v0/live"); then
+        HTTP_CODE="000"
+    fi
@@
-done
-set -e
+done

Also applies to: 105-105

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/buildspec/register.sh` around lines 76 - 96, The polling loop in
register.sh disables errexit with set +e, causing all commands in the block to
become non-fatal; keep errexit enabled and handle only the expected curl failure
path locally around the HTTP request in the retry loop. Update the logic around
RETRY_COUNT, SECURITY_TOKEN_HEADER, and the curl invocation that sets HTTP_CODE
so failures are captured and retried without masking unrelated errors.

Sources: Path instructions, Linters/SAST tools

🧹 Nitpick comments (1)
argocd/config/management-cluster/hypershift/templates/05-job.yaml (1)

83-116: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Two adjacent identical conditionals could be merged.

Lines 83-116 reopen {{- if .Values.hypershift.externalDns.domain }} immediately after the block closed at line 82 with the same condition. Functionally fine (once the backslash issue above is fixed), but a single contiguous if block spanning the install flags and the post-install DNS patching would be simpler to reason about.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@argocd/config/management-cluster/hypershift/templates/05-job.yaml` around
lines 83 - 116, The HyperShift template has two back-to-back conditionals with
the same .Values.hypershift.externalDns.domain guard, which should be merged
into one contiguous block. Update the conditional around the install flags and
the post-install DNS patching in 05-job.yaml so there is a single if/fi section
spanning both behaviors, using the existing
.Values.hypershift.externalDns.domain check and the DNS_ZONE_OPERATOR_ROLE_ARN
patch logic together.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/validate-mc-k8s.sh`:
- Around line 115-137: The HyperShift CRD check is incorrectly piping kubectl
output into grep because stdout is redirected before grep runs, so HostedCluster
detection never works. Update the detection logic in validate-mc-k8s.sh around
the HostedCluster validation block to let kubectl api-resources output flow into
grep, then keep the existing HostedCluster loop and availability checks gated
behind that corrected condition. Use the kubectl api-resources / grep
HostedCluster check as the locating symbol, and apply the same fix to the other
referenced HostedCluster check block.

In `@scripts/validate-rc-aws.sh`:
- Around line 94-96: The AWS probe commands in validate-rc-aws.sh are still
allowed to abort the script under set -euo pipefail, so failures from aws eks
list-addons and the nodegroup health query should be handled explicitly instead
of terminating early. Update the addon_json assignment and the later
health-check logic to capture nonzero exit status, continue execution, and
record the validation as failed while still reaching the summary output. Keep
the fix localized around the addon_json and nodegroup-check sections so the
validator remains resilient to transient AWS CLI errors.
- Around line 223-239: The warning in the PLATFORM_API_TG_ARN fallback is
pointing users to the wrong ARN source: describe-target-health in
validate-rc-aws.sh expects a target group ARN, but the suggested kubectl
jsonpath reads the service’s load balancer ARN annotation. Update the warn
message near the PLATFORM_API_TG_ARN check to tell users how to obtain the
correct target group ARN instead, using the existing validate-rc-aws.sh target
health logic as the reference point.

In `@terraform/modules/eks-cluster/iam.tf`:
- Around line 373-386: The `aws_sqs_queue_policy.karpenter_interruption` policy
currently allows `events.amazonaws.com` to send messages without source
restrictions. Update the `Statement` in this resource to add conditions that
scope access to the existing `aws_cloudwatch_event_rule.karpenter[*].arn` values
via `aws:SourceArn` and to `data.aws_caller_identity.current.account_id` via
`aws:SourceAccount`, while keeping the `Sid`, `Principal`, and `sqs:SendMessage`
permissions aligned with the current `karpenter_interruption` queue setup.

---

Outside diff comments:
In `@scripts/buildspec/register.sh`:
- Around line 76-96: The polling loop in register.sh disables errexit with set
+e, causing all commands in the block to become non-fatal; keep errexit enabled
and handle only the expected curl failure path locally around the HTTP request
in the retry loop. Update the logic around RETRY_COUNT, SECURITY_TOKEN_HEADER,
and the curl invocation that sets HTTP_CODE so failures are captured and retried
without masking unrelated errors.

---

Nitpick comments:
In `@argocd/config/management-cluster/hypershift/templates/05-job.yaml`:
- Around line 83-116: The HyperShift template has two back-to-back conditionals
with the same .Values.hypershift.externalDns.domain guard, which should be
merged into one contiguous block. Update the conditional around the install
flags and the post-install DNS patching in 05-job.yaml so there is a single
if/fi section spanning both behaviors, using the existing
.Values.hypershift.externalDns.domain check and the DNS_ZONE_OPERATOR_ROLE_ARN
patch logic together.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: df3881f9-1928-4d9d-9248-578c79167100

📥 Commits

Reviewing files that changed from the base of the PR and between dc0e0ba and b206d92.

📒 Files selected for processing (54)
  • Makefile
  • argocd/config/management-cluster/eks-nodepool/templates/00-nodeclass.yaml
  • argocd/config/management-cluster/eks-nodepool/templates/10-nodepool.yaml
  • argocd/config/management-cluster/eks-nodepool/values.yaml
  • argocd/config/management-cluster/hypershift/templates/05-job.yaml
  • argocd/config/regional-cluster/aws-load-balancer-controller/Chart.yaml
  • argocd/config/regional-cluster/aws-load-balancer-controller/values.yaml
  • argocd/config/regional-cluster/eks-nodepool/templates/00-nodeclass.yaml
  • argocd/config/regional-cluster/eks-nodepool/templates/10-nodepool.yaml
  • argocd/config/regional-cluster/eks-nodepool/values.yaml
  • argocd/config/regional-cluster/platform-api/templates/targetgroupbinding.yaml
  • argocd/config/shared/argocd/values.yaml
  • argocd/config/shared/storageclass/templates/gp3.yaml
  • config/templates/argocd-bootstrap/applicationset.yaml.j2
  • deploy/ephemeral/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/ephemeral/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • docs/README.md
  • docs/design/fips-eks-compute.md
  • docs/design/fully-private-eks-bootstrap.md
  • docs/design/gitops-cluster-configuration.md
  • docs/design/karpenter-node-provisioning.md
  • docs/design/logging-platform.md
  • docs/design/rate-limiting-architecture.md
  • docs/design/thanos-metrics-infrastructure.md
  • docs/design/zoa-trusted-actions.md
  • scripts/buildspec/register.sh
  • scripts/validate-mc-aws.sh
  • scripts/validate-mc-k8s.sh
  • scripts/validate-rc-aws.sh
  • scripts/validate-rc-k8s.sh
  • terraform/config/management-cluster/main.tf
  • terraform/config/regional-cluster/imports.sh
  • terraform/config/regional-cluster/main.tf
  • terraform/modules/api-gateway/outputs.tf
  • terraform/modules/aws-load-balancer-controller/README.md
  • terraform/modules/aws-load-balancer-controller/iam.tf
  • terraform/modules/aws-load-balancer-controller/main.tf
  • terraform/modules/aws-load-balancer-controller/outputs.tf
  • terraform/modules/aws-load-balancer-controller/variables.tf
  • terraform/modules/aws-load-balancer-controller/versions.tf
  • terraform/modules/ecs-bootstrap/README.md
  • terraform/modules/ecs-bootstrap/main.tf
  • terraform/modules/ecs-bootstrap/variables.tf
  • terraform/modules/eks-cluster/README.md
  • terraform/modules/eks-cluster/data.tf
  • terraform/modules/eks-cluster/iam.tf
  • terraform/modules/eks-cluster/locals.tf
  • terraform/modules/eks-cluster/main.tf
  • terraform/modules/eks-cluster/outputs.tf
  • terraform/modules/eks-cluster/variables.tf
  • terraform/modules/eks-cluster/versions.tf
  • terraform/modules/hyperfleet-infrastructure/amazonmq.tf
✅ Files skipped from review due to trivial changes (17)
  • deploy/integration/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • docs/design/fully-private-eks-bootstrap.md
  • docs/design/rate-limiting-architecture.md
  • argocd/config/management-cluster/eks-nodepool/values.yaml
  • terraform/modules/aws-load-balancer-controller/versions.tf
  • docs/README.md
  • config/templates/argocd-bootstrap/applicationset.yaml.j2
  • terraform/modules/hyperfleet-infrastructure/amazonmq.tf
  • docs/design/logging-platform.md
  • docs/design/karpenter-node-provisioning.md
  • docs/design/zoa-trusted-actions.md
  • docs/design/gitops-cluster-configuration.md
  • terraform/modules/aws-load-balancer-controller/README.md
  • docs/design/fips-eks-compute.md
  • argocd/config/regional-cluster/platform-api/templates/targetgroupbinding.yaml
  • terraform/modules/ecs-bootstrap/README.md
  • docs/design/thanos-metrics-infrastructure.md
🚧 Files skipped from review as they are similar to previous changes (29)
  • argocd/config/regional-cluster/eks-nodepool/values.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • deploy/ephemeral/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • terraform/modules/eks-cluster/locals.tf
  • deploy/ephemeral/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • argocd/config/management-cluster/eks-nodepool/templates/10-nodepool.yaml
  • terraform/modules/eks-cluster/versions.tf
  • terraform/modules/aws-load-balancer-controller/main.tf
  • Makefile
  • terraform/modules/eks-cluster/data.tf
  • argocd/config/regional-cluster/aws-load-balancer-controller/values.yaml
  • terraform/modules/api-gateway/outputs.tf
  • terraform/modules/eks-cluster/outputs.tf
  • terraform/config/management-cluster/main.tf
  • terraform/config/regional-cluster/imports.sh
  • terraform/config/regional-cluster/main.tf
  • argocd/config/shared/argocd/values.yaml
  • terraform/modules/aws-load-balancer-controller/iam.tf
  • terraform/modules/eks-cluster/README.md
  • terraform/modules/eks-cluster/main.tf
  • argocd/config/shared/storageclass/templates/gp3.yaml
  • terraform/modules/aws-load-balancer-controller/variables.tf
  • terraform/modules/ecs-bootstrap/main.tf
  • argocd/config/regional-cluster/eks-nodepool/templates/10-nodepool.yaml
  • scripts/validate-mc-aws.sh
  • terraform/modules/aws-load-balancer-controller/outputs.tf
  • terraform/modules/eks-cluster/variables.tf
  • terraform/modules/ecs-bootstrap/variables.tf
  • argocd/config/regional-cluster/aws-load-balancer-controller/Chart.yaml

Comment thread scripts/validate-mc-k8s.sh Outdated
Comment thread scripts/validate-rc-aws.sh
Comment thread scripts/validate-rc-aws.sh
Comment thread terraform/modules/eks-cluster/iam.tf

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/validate-mc-k8s.sh`:
- Around line 276-283: The diagnostic output in the application health check
still prints a raw null message for conditions because the jq expression in the
kubectl get application path uses .message without a fallback. Update the
condition-printing jq filter in the health/degraded branch so it mirrors the
existing .health.message handling by defaulting missing condition messages to a
placeholder like "-" to avoid literal "null" in the output.

In `@scripts/validate-rc-k8s.sh`:
- Around line 235-241: The `_pia_ready` check in `validate-rc-k8s.sh` can still
be empty even when `kubectl get daemonset` succeeds, which makes the `[[
"$_pia_ready" -ge 1 ]]` comparison emit a bash unary-operator warning. Update
the `eks-pod-identity-agent` readiness logic to treat empty jsonpath output like
zero by normalizing `_pia_ready` before the numeric test, or by using a default
in the assignment, so the `pass`/`fail` branch remains the same without noisy
stderr output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b89ad365-99c5-48c6-bb52-f7d5adc2946e

📥 Commits

Reviewing files that changed from the base of the PR and between b206d92 and 6451ae5.

📒 Files selected for processing (8)
  • config/templates/argocd-bootstrap/applicationset.yaml.j2
  • deploy/ephemeral/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/ephemeral/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • scripts/validate-mc-k8s.sh
  • scripts/validate-rc-k8s.sh
  • terraform/modules/eks-cluster/iam.tf
🚧 Files skipped from review as they are similar to previous changes (1)
  • terraform/modules/eks-cluster/iam.tf

Comment thread scripts/validate-mc-k8s.sh Outdated
Comment thread scripts/validate-rc-k8s.sh
@theautoroboto

Copy link
Copy Markdown
Contributor Author

/test on-demand-e2e

2 similar comments
@theautoroboto

Copy link
Copy Markdown
Contributor Author

/test on-demand-e2e

@theautoroboto

Copy link
Copy Markdown
Contributor Author

/test on-demand-e2e

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
argocd/config/management-cluster/hypershift/templates/05-job.yaml (1)

49-49: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Wait for the PrometheusRule CRD too. This gate only checks servicemonitors.monitoring.coreos.com, but hypershift install also applies PrometheusRule manifests. Add a wait for prometheusrules.monitoring.coreos.com as well so the Job doesn’t race the monitoring chart.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@argocd/config/management-cluster/hypershift/templates/05-job.yaml` at line
49, The wait gate in the hypershift Job only checks for the ServiceMonitor CRD,
but the install flow also creates PrometheusRule resources, so the Job can still
race the monitoring chart. Update the CRD readiness check in the job template to
wait for prometheusrules.monitoring.coreos.com as well, alongside the existing
servicemonitors.monitoring.coreos.com check, using the existing shell block in
the job definition.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@argocd/config/management-cluster/hypershift/templates/05-job.yaml`:
- Around line 66-72: The wait loop only checks for the ServiceMonitor CRD, so
hypershift install can still race if PrometheusRule is not ready yet. Update the
readiness gate in the hypershift job template so the same wait block also
verifies prometheusrules.monitoring.coreos.com before proceeding, keeping the
existing kubectl get crd loop and waiting message aligned with the install
requirements.

---

Outside diff comments:
In `@argocd/config/management-cluster/hypershift/templates/05-job.yaml`:
- Line 49: The wait gate in the hypershift Job only checks for the
ServiceMonitor CRD, but the install flow also creates PrometheusRule resources,
so the Job can still race the monitoring chart. Update the CRD readiness check
in the job template to wait for prometheusrules.monitoring.coreos.com as well,
alongside the existing servicemonitors.monitoring.coreos.com check, using the
existing shell block in the job definition.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 73c029cf-959b-4d74-ac54-fadcd90ef5e1

📥 Commits

Reviewing files that changed from the base of the PR and between 3e75e48 and e2c3e96.

📒 Files selected for processing (3)
  • argocd/config/management-cluster/hypershift/templates/05-job.yaml
  • scripts/validate-mc-k8s.sh
  • scripts/validate-rc-k8s.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/validate-mc-k8s.sh
  • scripts/validate-rc-k8s.sh

Comment thread argocd/config/management-cluster/hypershift/templates/05-job.yaml
…troller

Replaces EKS Auto Mode with OSS Karpenter for node provisioning and OSS AWS
Load Balancer Controller for TargetGroupBinding CRDs on both RC and MC.

Key changes:
- eks-cluster module: Karpenter bootstrap node group, IRSA/Pod Identity for
  Karpenter and LBC, EC2NodeClaimTagging IAM statement for nodeclaim.tagging
  controller, CoreDNS/metrics-server/pod-identity addon ordering on bootstrap NG
- ecs-bootstrap module: skip guard checks readyReplicas > 0 instead of
  deployment existence
- eks-nodepool chart: EC2NodeClass + NodePool for both RC and MC
- ApplicationSet: RespectIgnoreDifferences + ignoreDifferences for LBC webhook
  caBundle, TLS secret, and TargetGroupBinding status to prevent controller-
  managed fields from causing OutOfSync
- loki, thanos, platform-api: TargetGroupBinding apiVersion updated from
  eks.amazonaws.com/v1 (Auto Mode) to elbv2.k8s.aws/v1beta1 (OSS LBC)
- MQ: fix log group CloudWatch import ID; api-gateway: handle null invoke_url

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
theautoroboto and others added 2 commits July 9, 2026 09:38
…r CRD race

Guard all external-dns install flags behind {{ if .Values.hypershift.externalDns.domain }}
so the job does not pass empty flags when external-dns is not configured.

Add a wait loop before hypershift install that blocks until
servicemonitors.monitoring.coreos.com is registered. The monitoring chart
(kube-prometheus-stack) deploys concurrently and may not have installed
Prometheus Operator CRDs before the install job runs; without the wait,
hypershift install exits non-zero causing the Job and ArgoCD app to be Degraded.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
validate-rc-k8s.sh and validate-mc-k8s.sh check nodes, Karpenter, LBC,
core add-ons, platform services, HyperShift operator, and ArgoCD health
on the Regional Cluster and Management Cluster respectively.

ArgoCD Degraded diagnostic emits the app-level health message, conditions,
and per-resource health for Missing/Unknown/Degraded resources. HyperShift
CRD presence check uses 2>/dev/null (not &>/dev/null) so the grep receives
kubectl stdout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/validate-rc-k8s.sh`:
- Around line 113-128: The Karpenter placement check in the shell validation
script can incorrectly report PASS when no Karpenter pods are found because
kp_nodes is empty and off_bootstrap stays at 0. Update the validation logic
around the kp_nodes loop so pass "Karpenter pods scheduled on bootstrap node
group" only runs when at least one pod/node was observed, and otherwise emit a
warning or failure consistent with the earlier pod check. Use the existing
kp_nodes, off_bootstrap, and pass/warn flow to keep the behavior aligned with
the rest of validate-rc-k8s.sh.
- Around line 314-316: The ArgoCD diagnostics in the kubectl/jq pipeline
currently print literal null when a condition message is missing; update the
logic around the application status parsing to default absent messages to a
readable placeholder before formatting the output. Keep the change in the same
diagnostics block that uses kubectl get application and jq, and ensure the
printed condition line still shows the type while substituting a sensible
fallback for empty or null .message values.

In `@terraform/modules/eks-cluster/iam.tf`:
- Around line 4-10: The compute mode comment is out of date: it still says
var.enable_karpenter defaults to false even though the PR changes the default to
true. Update the documentation block in iam.tf near the enable_karpenter
description so the default branch and the listed role/policy behavior match the
current default, keeping the EKS Auto Mode vs OSS Karpenter summary aligned with
the actual variable behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8c4c89ac-7098-4fe6-aa69-2a5a5f0ce992

📥 Commits

Reviewing files that changed from the base of the PR and between e2c3e96 and 3e0a87a.

📒 Files selected for processing (45)
  • Makefile
  • argocd/config/management-cluster/eks-nodepool/templates/00-nodeclass.yaml
  • argocd/config/management-cluster/eks-nodepool/templates/10-nodepool.yaml
  • argocd/config/management-cluster/eks-nodepool/values.yaml
  • argocd/config/management-cluster/hypershift/templates/05-job.yaml
  • argocd/config/regional-cluster/eks-nodepool/templates/00-nodeclass.yaml
  • argocd/config/regional-cluster/eks-nodepool/templates/10-nodepool.yaml
  • argocd/config/regional-cluster/eks-nodepool/values.yaml
  • argocd/config/regional-cluster/loki/templates/targetgroupbinding.yaml
  • argocd/config/regional-cluster/platform-api/templates/targetgroupbinding.yaml
  • argocd/config/regional-cluster/thanos/templates/targetgroupbinding.yaml
  • argocd/config/shared/argocd/values.yaml
  • argocd/config/shared/storageclass/templates/gp3.yaml
  • config/templates/argocd-bootstrap/applicationset.yaml.j2
  • deploy/ephemeral/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/ephemeral/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • deploy/integration/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • docs/README.md
  • docs/design/fips-eks-compute.md
  • docs/design/fully-private-eks-bootstrap.md
  • docs/design/gitops-cluster-configuration.md
  • docs/design/logging-platform.md
  • docs/design/rate-limiting-architecture.md
  • docs/design/thanos-metrics-infrastructure.md
  • docs/design/zoa-trusted-actions.md
  • scripts/buildspec/register.sh
  • scripts/validate-mc-k8s.sh
  • scripts/validate-rc-k8s.sh
  • terraform/config/management-cluster/main.tf
  • terraform/config/regional-cluster/imports.sh
  • terraform/config/regional-cluster/main.tf
  • terraform/modules/api-gateway/outputs.tf
  • terraform/modules/ecs-bootstrap/README.md
  • terraform/modules/ecs-bootstrap/main.tf
  • terraform/modules/ecs-bootstrap/variables.tf
  • terraform/modules/eks-cluster/README.md
  • terraform/modules/eks-cluster/data.tf
  • terraform/modules/eks-cluster/iam.tf
  • terraform/modules/eks-cluster/locals.tf
  • terraform/modules/eks-cluster/main.tf
  • terraform/modules/eks-cluster/outputs.tf
  • terraform/modules/eks-cluster/variables.tf
  • terraform/modules/eks-cluster/versions.tf
  • terraform/modules/hyperfleet-infrastructure/amazonmq.tf
✅ Files skipped from review due to trivial changes (12)
  • argocd/config/regional-cluster/platform-api/templates/targetgroupbinding.yaml
  • docs/README.md
  • docs/design/rate-limiting-architecture.md
  • terraform/modules/hyperfleet-infrastructure/amazonmq.tf
  • argocd/config/management-cluster/eks-nodepool/values.yaml
  • docs/design/fully-private-eks-bootstrap.md
  • docs/design/logging-platform.md
  • Makefile
  • docs/design/gitops-cluster-configuration.md
  • docs/design/zoa-trusted-actions.md
  • terraform/modules/eks-cluster/README.md
  • terraform/modules/ecs-bootstrap/README.md
🚧 Files skipped from review as they are similar to previous changes (27)
  • argocd/config/management-cluster/eks-nodepool/templates/10-nodepool.yaml
  • deploy/ephemeral/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • argocd/config/regional-cluster/eks-nodepool/values.yaml
  • deploy/ephemeral/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • argocd/config/regional-cluster/loki/templates/targetgroupbinding.yaml
  • terraform/modules/eks-cluster/versions.tf
  • terraform/modules/api-gateway/outputs.tf
  • deploy/integration/us-east-1/argocd-bootstrap-regional-cluster/applicationset.yaml
  • terraform/config/regional-cluster/imports.sh
  • deploy/integration/us-east-1/argocd-bootstrap-management-cluster/applicationset.yaml
  • argocd/config/regional-cluster/eks-nodepool/templates/10-nodepool.yaml
  • terraform/modules/eks-cluster/variables.tf
  • config/templates/argocd-bootstrap/applicationset.yaml.j2
  • terraform/config/management-cluster/main.tf
  • argocd/config/shared/storageclass/templates/gp3.yaml
  • argocd/config/regional-cluster/thanos/templates/targetgroupbinding.yaml
  • terraform/modules/eks-cluster/locals.tf
  • terraform/modules/ecs-bootstrap/variables.tf
  • docs/design/thanos-metrics-infrastructure.md
  • argocd/config/management-cluster/hypershift/templates/05-job.yaml
  • terraform/config/regional-cluster/main.tf
  • terraform/modules/eks-cluster/data.tf
  • argocd/config/shared/argocd/values.yaml
  • terraform/modules/eks-cluster/outputs.tf
  • terraform/modules/eks-cluster/main.tf
  • docs/design/fips-eks-compute.md
  • terraform/modules/ecs-bootstrap/main.tf

Comment thread scripts/validate-rc-k8s.sh
Comment thread scripts/validate-rc-k8s.sh Outdated
Comment thread terraform/modules/eks-cluster/iam.tf Outdated

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/validate-mc-k8s.sh`:
- Around line 256-260: The ArgoCD application check in the validation script is
failing open because `kubectl get applications` errors are hidden and treated as
empty output. Update the `not_synced`/`total` logic in `validate-mc-k8s.sh` to
first capture the application list with an explicit `if ! apps=$(kubectl get
applications ...)` failure branch, and only run the `awk`/`grep` filtering when
the list was successfully retrieved. Make sure the `pass "All ${total} ArgoCD
applications Synced"` path is only reachable when the `kubectl` call succeeds
and applications are actually listed.
- Around line 43-56: The pods_running helper currently treats any pod with phase
Running or Completed as healthy, which misses pods that are still not ready.
Update pods_running to check readiness from kubectl output in addition to the
pod phase, and only return success when all matching pods are both Running and
fully READY. Keep the logic localized to pods_running and its kubectl get
pods/awk/grep pipeline so unhealthy add-ons are not reported as passing.
- Around line 167-174: The NodePool readiness check in validate-mc-k8s.sh should
guard against an unset .status.replicas before doing a numeric test, since the
current ready variable can be empty and trigger a bash integer-comparison
warning. Update the NodePool status handling around the kubectl jsonpath reads
and the pass/fail branch so ready defaults to 0 when missing, then keep the [[
"$ready" -ge 1 ]] comparison safe and deterministic.
- Around line 71-78: The node readiness check in validate-mc-k8s.sh is treating
a failed or empty kubectl get nodes result as success because the pipeline is
masked with || true. Update the readiness logic around not_ready/node_count so
kubectl failures are handled explicitly: capture the command status, fail if
node listing does not succeed, and only call pass in the success path when
kubectl returns nodes and all are Ready.

In `@scripts/validate-rc-k8s.sh`:
- Around line 74-80: The node readiness check in validate-rc-k8s.sh is treating
a failed kubectl get nodes call as success because stderr is discarded and the
empty result falls through to the “All nodes are Ready” branch. Update the
readiness logic around not_ready/node_count so kubectl failures are detected and
cause fail immediately, using the existing pass and fail helpers; only report
all nodes ready after a successful node listing, and avoid relying on an empty
not_ready value when the command itself did not succeed.
- Around line 290-294: The ArgoCD readiness check in the not_synced validation
block is failing open because both kubectl queries suppress errors, so missing
CRDs or RBAC failures can be reported as “All 0 applications Synced.” Update the
application listing logic to detect kubectl failures explicitly and treat them
as a hard failure instead of continuing to pass, and apply the same fail-closed
handling to the related application checks referenced by the not_synced and
total query flow. Use the existing pass/fail reporting helpers in
scripts/validate-rc-k8s.sh so any listing error is surfaced clearly rather than
masked by awk/grep/wc pipelines.
- Around line 45-58: The pods_running helper currently checks only pod phase via
kubectl get pods and awk, so it can miss pods that are Running but not Ready.
Update pods_running to verify container readiness using kubectl’s ready
status/condition (for example, inspect READY or a Ready condition) for the
matching pods, while keeping the existing namespace/selector handling intact.
Ensure the function still returns non-zero when no pods are found or when any
selected pod is not ready.
- Around line 90-96: The bootstrap taint check in validate-rc-k8s.sh is counting
taint entries instead of tainted nodes, so it can pass even when some bootstrap
nodes lack CriticalAddonsOnly. Update the kubectl/jq pipeline around taint_count
to count only nodes whose spec.taints includes that key, and compare that number
against the total bootstrap node count from the same label selector. Keep the
pass/warn logic in the same validation block, but base it on tainted nodes
versus all bootstrap nodes rather than raw taint occurrences.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4def09c8-aea6-4a1c-a152-b31d4ab21f93

📥 Commits

Reviewing files that changed from the base of the PR and between 3e0a87a and 1a0fabb.

📒 Files selected for processing (3)
  • argocd/config/management-cluster/hypershift/templates/05-job.yaml
  • scripts/validate-mc-k8s.sh
  • scripts/validate-rc-k8s.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • argocd/config/management-cluster/hypershift/templates/05-job.yaml

Comment thread scripts/validate-mc-k8s.sh
Comment thread scripts/validate-mc-k8s.sh Outdated
Comment thread scripts/validate-mc-k8s.sh
Comment thread scripts/validate-mc-k8s.sh Outdated
Comment thread scripts/validate-rc-k8s.sh
Comment thread scripts/validate-rc-k8s.sh Outdated
Comment thread scripts/validate-rc-k8s.sh Outdated
Comment thread scripts/validate-rc-k8s.sh Outdated
theautoroboto and others added 3 commits July 9, 2026 11:05
- pods_running(): check READY column (e.g. 1/1) in addition to STATUS phase,
  so Running-but-not-Ready containers are caught
- Node readiness: fail-closed on kubectl error instead of passing "All 0 nodes Ready"
- RC taint check: count tainted nodes (not taint entries) to avoid double-counting
- RC Karpenter placement: guard empty nodeName list to prevent false pass
- MC NodePool replicas: default empty .status.replicas to 0 so arithmetic is safe
- Condition diag: use // "-" fallback so null .message doesn't print literal "null"

MC-6 (ArgoCD listing) already fixed in a prior commit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Documents the architecture decision to use OSS Karpenter with a
dedicated bootstrap node group instead of EKS Auto Mode, covering
EC2NodeClass FIPS configuration, NodePool design, and pod scheduling
constraints for bootstrap-critical workloads.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
EKS Auto Mode bundled LBC natively; OSS Karpenter does not. Without LBC,
TargetGroupBinding CRDs are absent and platform-api stays OutOfSync/Missing.

- terraform/modules/aws-load-balancer-controller: IAM role with Pod Identity
  association and the full LBC IAM policy (ec2/elasticloadbalancing permissions)
- argocd/config/regional-cluster/aws-load-balancer-controller: Helm wrapper
  chart deploying the upstream aws-load-balancer-controller chart
- scripts/validate-rc-aws.sh, validate-mc-aws.sh: AWS-level checks (node groups,
  load balancers, IAM role bindings) complementing the K8s-level scripts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@theautoroboto

Copy link
Copy Markdown
Contributor Author

/retest

@theautoroboto

Copy link
Copy Markdown
Contributor Author

/test on-demand-e2e

@theautoroboto

Copy link
Copy Markdown
Contributor Author

/test images

theautoroboto and others added 7 commits July 9, 2026 15:49
Hardcoded comparison against 2 breaks if the bootstrap node group is
ever scaled. Compare tainted node count against the observed
bootstrap_nodes value instead, and include the ratio in the message.
Karpenter-provisioned EC2 nodes are not in Terraform state. When
terraform destroy reaches subnet/VPC deletion it fails with
DependencyViolation because orphaned instances still hold ENIs.

_drain_karpenter_nodes() runs after _purge_clusters() (so Karpenter
can no longer reprovision) and before _run_teardown(). It finds all
instances tagged karpenter.sh/managed-by=<cluster-name> for the RC
and each MC in the region config, terminates them, and waits for
termination before handing off to terraform destroy.

Tracks ROSAENG-61588.
… destroy

Karpenter-provisioned EC2 nodes are not in Terraform state. When the
EKS cluster is deleted the Karpenter controller dies with it, leaving
orphaned instances whose ENIs block VPC/subnet deletion with
DependencyViolation.

Adds a local-exec destroy provisioner to aws_eks_cluster.main. It runs
immediately before the EKS API call to delete the cluster, finds all
EC2 instances tagged karpenter.sh/managed-by=<cluster-name>, terminates
them, and waits for completion. on_failure=continue ensures the destroy
is not blocked if no instances are found or the CLI is unavailable.

Applies to both RC and MC clusters via the shared eks-cluster module,
covering all terraform destroy paths.

Tracks ROSAENG-61588.
Terraform forbids referencing data sources in destroy-time provisioners.
Extract the region from self.arn (arn:aws:eks:<region>:...) instead.
The API Gateway access log group is auto-created by AWS when logging is
enabled. Import it so Terraform can manage retention and KMS encryption.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
karpenter.sh/managed-by was a v0.x tag. Karpenter v1.x nodes are tagged
with karpenter.sh/nodeclaim (per node) and aws:eks:cluster-name (added
by EKS). The old filter matched nothing, leaving nodes alive to block
subnet deletion with DependencyViolation.

New filter: aws:eks:cluster-name=<cluster> AND tag-key karpenter.sh/nodeclaim.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@theautoroboto

Copy link
Copy Markdown
Contributor Author

/test on-demand-e2e

@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown

@theautoroboto: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/on-demand-e2e f68e623 link true /test on-demand-e2e

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant