Skip to content

feat(common): IRSA preflight init-container hard gate#71

Closed
OleksandrUA wants to merge 1 commit into
mainfrom
KEEP-854-irsa-preflight-init-container
Closed

feat(common): IRSA preflight init-container hard gate#71
OleksandrUA wants to merge 1 commit into
mainfrom
KEEP-854-irsa-preflight-init-container

Conversation

@OleksandrUA

Copy link
Copy Markdown
Contributor

What

Adds an opt-in serviceAccount.irsaCheck.initContainer to the common chart. When enabled it injects an irsa-preflight init container into the Deployment/StatefulSet that assumes the IRSA role and runs a read-only AWS probe before the main container starts:

  • aws sts get-caller-identity - proves the assume-role works
  • aws sqs get-queue-url --queue-name <queue> - proves SQS reachability and the role's queue grants

If the probe fails the pod never becomes Ready, so helm upgrade --atomic --wait rolls the whole release back instead of shipping a credential-less or broken-IRSA workload.

Why

The existing irsaCheck helm-test is a post-deploy sanity check - it runs after the release already succeeded, so a broken IRSA config can still roll out. This adds the missing hard gate at pod startup. The two are complementary; the helm-test is kept.

The values key is AWS-service-agnostic so other read-only probes can be added later without renaming it. get-queue-url is the only truly read-only call within the keeperhub queue policy (GetQueueAttributes is not granted; ReceiveMessage would side-effect a message).

Changes

  • common.irsaPreflightInitContainer helper, rendered by deployment.yaml and statefulset.yaml (single initContainers: block, preflight first, coexists with user-supplied init containers).
  • New serviceAccount.irsaCheck.initContainer values block (enabled/region/queueName/resources), default disabled.
  • helm-unittest coverage (disabled-renders-nothing, enabled-renders-correctly, default-resources, coexistence-single-block).
  • Version bumps: common 0.4.0 -> 0.5.0, keeperhub-stack 0.2.0 -> 0.3.0 (common dependency re-pinned and repackaged).

Verification

  • helm unittest charts/common: 10/10 pass.
  • Umbrella rendered with the real staging and prod deploy values: all 5 components get exactly one irsa-preflight init container with the correct region/queue per env; the app component keeps its db-migration init container after the preflight.
  • Not exercised in CI dry-run (kind has no IRSA, so the probe would fail there by design); the live STS/SQS path is validated staging-first on EKS.

Add an opt-in serviceAccount.irsaCheck.initContainer that injects an
irsa-preflight init container into the Deployment/StatefulSet. It assumes
the IRSA role and runs a read-only AWS probe (aws sts get-caller-identity
plus aws sqs get-queue-url) before the main container starts, so a
credential-less or broken-IRSA pod never becomes Ready and
`helm upgrade --atomic --wait` rolls the release back instead of running it.

This complements the existing irsaCheck helm-test (a post-deploy sanity
check) with a hard gate at startup. The key is kept AWS-service-agnostic so
other read-only probes can be added later; get-queue-url is the only truly
read-only call within the keeperhub queue policy.

Bumps common 0.4.0 -> 0.5.0 and keeperhub-stack 0.2.0 -> 0.3.0 (common
dependency re-pinned and repackaged). Adds helm-unittest coverage.

KEEP-854
@github-actions

Copy link
Copy Markdown

🎉 Helm Chart Tests Passed!

All modified charts have been successfully validated:

Chart Version Check Template Validation Dry-run Installation Overall Status
common ✅ Incremented ✅ Passed ✅ Passed ✅ Passed
keeperhub-stack ✅ Incremented ✅ Passed ✅ Passed ✅ Passed

Summary:

  • ✅ Charts tested: common, keeperhub-stack
  • ✅ All template validations passed
  • ✅ All dry-run installations passed

📋 Detailed Information:

The PR is ready for review! 🚀

Note: Charts will be automatically released when this PR is merged to main.

@OleksandrUA

Copy link
Copy Markdown
Contributor Author

Closing - the IRSA preflight does not need a dedicated chart feature. The existing common chart already supports deployment.initContainers, so the gate is implemented as a plain init-container entry in the keeperhub deploy values (KeeperHub/keeperhub#1615) with no chart change, version bump, or republish. Keeps it modular and avoids touching the shared chart.

@OleksandrUA OleksandrUA deleted the KEEP-854-irsa-preflight-init-container branch June 22, 2026 14:06
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