Skip to content

[patch] PostSync hook to rotate ECR token on install#423

Merged
tomklapiscak merged 3 commits intomainfrom
rotate-ecr-on-install
Mar 27, 2026
Merged

[patch] PostSync hook to rotate ECR token on install#423
tomklapiscak merged 3 commits intomainfrom
rotate-ecr-on-install

Conversation

@tomklapiscak
Copy link
Copy Markdown
Contributor

@tomklapiscak tomklapiscak commented Mar 27, 2026

Description

In GovCloud the ecr-token-updater_CronJob is responsible for periodically obtaining a short-lived ECR token and setting it in the cluster's global image pull secrets. Without this, the cluster will not be able to fetch images from the ECR mirror configured by the ImageDigestMirrorSet.

The problem is that the the CronJob is scheduled to run every 11 hours, and until this happens the cluster will not be able to pull any images. This breaks the install process until the CronJob has been run; bundle unpacking jobs will fail to run due to ImagePull errors.

The fix in this PR adds an additional one-time invocation of the ECR token rotation procedur when the image-mirroring application is synced during installation.

Template is used to prevent code duplication. Since this is the first definition of a Job resource inside a template, the set-cli-image.digest.sh and verify-job-definitions.sh scripts have been updated to also inspect .tpl files.

Related Issue

https://jsw.ibm.com/browse/MASCORE-13057

Testing

Verified ecr-token-updater-init Job is now run when the image-mirroring application is synced, in addition to the regular cronjob:

image

Template used to prevent code duplication
Job verification scripts updated to inspect templates too
@tomklapiscak tomklapiscak marked this pull request as draft March 27, 2026 12:25
@tomklapiscak tomklapiscak marked this pull request as ready for review March 27, 2026 15:37
@tomklapiscak tomklapiscak requested review from rbinns and terenceq March 27, 2026 15:37
@tomklapiscak tomklapiscak merged commit ce9c9ee into main Mar 27, 2026
2 checks passed
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.

2 participants