Skip to content

fix(install): run hub:create-mgmt-roles before hub:claim (ACK IAM prerequisite) - #861

Merged
allamand merged 1 commit into
release/v0.3.0-rc3from
fix/create-mgmt-roles-before-claim
Sep 3, 2026
Merged

fix(install): run hub:create-mgmt-roles before hub:claim (ACK IAM prerequisite)#861
allamand merged 1 commit into
release/v0.3.0-rc3from
fix/create-mgmt-roles-before-claim

Conversation

@allamand

@allamand allamand commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Problem

task install fails at hub:wait-for-eks after ~40 min with:

cniMetricsHelperPolicy.status.ackResourceMetadata.arn: no such key: arn (data pending)

Root cause: The eksclusterwithvpc RGD immediately creates ACK-managed IAM resources (Policy, Role, PodIdentityAssociation for cni-metrics-helper, adot-collector etc.) when KRO starts reconciling the claim. ACK EKS Capability assumes the peeks-cluster-mgmt-iam role (created by hub:create-mgmt-roles) to create those AWS resources. But hub:create-mgmt-roles was called inside hub:seed, which runs after hub:wait-for-eks. Without the cluster-mgmt-iam role, ACK cannot create cniMetricsHelperPolicy, so .status.ackResourceMetadata.arn stays empty, KRO cannot evaluate the expression, and the install hangs indefinitely.

Note: ACK in kind-kro-ack is an EKS Capability (runs AWS-side), not pods in the cluster.

Fix

  1. Move hub:create-mgmt-roles before hub:claim in the install DAG. The task is idempotent so running it twice (here + inside hub:seed) is safe.

  2. Fix the fallback role name in hub:create-mgmt-roles: was ...-argocd-capability-role (wrong), now ...-ack-capability-role (correct). This fallback is used when the task runs before the hub EKS exists (aws eks describe-capability returns empty).

Related

PR #835 (v0.3.0-rc3 teardown validation) — install failure observed on fresh account

…requisite)

## Root cause

task install fails at hub:wait-for-eks with:
  'cniMetricsHelperPolicy.status.ackResourceMetadata.arn: no such key: arn (data pending)'

The eksclusterwithvpc RGD immediately creates ACK-managed IAM resources
(Policy, Role, PodIdentityAssociation for cni-metrics-helper, adot-collector
etc.) when KRO starts reconciling the claim. ACK EKS Capability assumes the
peeks-cluster-mgmt-iam role to create those AWS resources. But hub:create-mgmt-roles
(which creates that role) was called inside hub:seed, which runs AFTER
hub:wait-for-eks. Without the cluster-mgmt-iam role, ACK cannot create
cniMetricsHelperPolicy, so .status.ackResourceMetadata.arn stays empty, KRO
cannot evaluate the expression, and the install hangs.

## Fix

1. Move hub:create-mgmt-roles to run BEFORE hub:claim in the install DAG.
   The task is idempotent (uses aws iam get-role before create) so running
   it twice (here + inside hub:seed) is safe.

2. Fix the fallback role name in hub:create-mgmt-roles ACK_CAPABILITY_ROLE
   var: was '...-argocd-capability-role' (wrong), now '...-ack-capability-role'
   (correct). The fallback is used when hub:create-mgmt-roles runs before the
   hub EKS cluster exists (so describe-capability returns empty).

## Note

The trust policy already uses the wildcard 'peeks-ack-*' pattern so both
the pre-claim (fallback name) and post-claim (actual name from describe-capability)
calls produce a working policy.
@allamand
allamand merged commit 763a303 into release/v0.3.0-rc3 Sep 3, 2026
allamand added a commit that referenced this pull request Sep 4, 2026
… yet

hub:create-mgmt-roles now runs before hub:claim (PR #861), so the hub EKS
cluster doesn't exist yet when ACK_CAPABILITY_ROLE is evaluated.
'aws eks describe-capability' returns empty string (not an error), and
'sed s|.*/||' on empty string returns empty string with exit 0, so the
'|| fallback' never triggered.

Add '| grep -v ^$' to filter empty lines, forcing the fallback to activate
when describe-capability returns nothing.
allamand added a commit that referenced this pull request Sep 4, 2026
hub:create-mgmt-roles now runs before hub:claim (PR #861). The final step
of this task applies an inline policy to the ACK capability role allowing it
to assume the cluster-mgmt roles. But the ACK capability role only exists
after the hub EKS cluster is created (and the ACK EKS Capability is registered).

When called before hub:claim, the role doesn't exist yet → exit 254.

Fix: add '2>/dev/null || echo ...' to skip gracefully. hub:seed re-runs
hub:create-mgmt-roles once the hub is up, at which point the ACK capability
role exists and the policy is applied correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant