feat(common): IRSA preflight init-container hard gate#71
Closed
OleksandrUA wants to merge 1 commit into
Closed
Conversation
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
🎉 Helm Chart Tests Passed!All modified charts have been successfully validated:
Summary:
📋 Detailed Information:
The PR is ready for review! 🚀 Note: Charts will be automatically released when this PR is merged to main. |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an opt-in
serviceAccount.irsaCheck.initContainerto thecommonchart. When enabled it injects anirsa-preflightinit 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 worksaws sqs get-queue-url --queue-name <queue>- proves SQS reachability and the role's queue grantsIf the probe fails the pod never becomes Ready, so
helm upgrade --atomic --waitrolls the whole release back instead of shipping a credential-less or broken-IRSA workload.Why
The existing
irsaCheckhelm-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-urlis the only truly read-only call within the keeperhub queue policy (GetQueueAttributesis not granted;ReceiveMessagewould side-effect a message).Changes
common.irsaPreflightInitContainerhelper, rendered bydeployment.yamlandstatefulset.yaml(singleinitContainers:block, preflight first, coexists with user-supplied init containers).serviceAccount.irsaCheck.initContainervalues block (enabled/region/queueName/resources), default disabled.0.4.0 -> 0.5.0, keeperhub-stack0.2.0 -> 0.3.0(common dependency re-pinned and repackaged).Verification
helm unittest charts/common: 10/10 pass.irsa-preflightinit container with the correct region/queue per env; the app component keeps itsdb-migrationinit container after the preflight.