Repository navigation
[feat] Use initImage for the AppArmor wait and installer containers - #429
cameronattard wants to merge 1 commit into
Conversation
[Medium impact] The change affects image selection for optional AppArmor workloads in the Helm chart. Add registry credentials to the installer pod before merging so private-image installs can start. Findings
Reviews (1) · Last reviewed commit: "[feat] Use initImage for the AppArmor wa..." · Reviewed by Greptile |
| initContainers: | ||
| - name: install | ||
| image: {{ .Values.codeExecutor.appArmorInstallerImage | default "busybox:1.37" }} | ||
| image: {{ .Values.codeExecutor.appArmorInstallerImage | default (include "retool.initImage" .) }} |
There was a problem hiding this comment.
The installer now uses initImage, but its pod never receives image.pullSecrets. If an operator points initImage.repository at a registry that requires login and supplies credentials through image.pullSecrets, the executors can pull the image but the installer cannot. On a fresh node, the AppArmor profile never loads and wait-for-apparmor waits forever.
Add the same pod-level imagePullSecrets block used by the executor deployments, and cover it in the new render test.
There was a problem hiding this comment.
Fixed in 6ee5acb: the installer DaemonSet now renders image.pullSecrets the same way as the executors, and test_apparmor_images.py checks it reaches the installer and both executors (and is absent by default).
The wait-for-apparmor init containers on the code executor and JS executor hardcoded busybox from Docker Hub, and the AppArmor installer DaemonSet defaulted to an unpinned busybox:1.37, so installs that mirror every image couldn't run them. Both now use initImage (codeExecutor.appArmorInstallerImage still overrides the DaemonSet). Defaults render the same pinned busybox. The installer DaemonSet also gets image.pullSecrets, like the executors, so an initImage in a registry that needs credentials can be pulled on every node.
68d4633 to
6ee5acb
Compare
What
The
wait-for-apparmorinit containers on the code executor and JS executor hardcodebusybox:1.37.0@sha256:...from Docker Hub. The AppArmor profile installer DaemonSet defaults to an unpinnedbusybox:1.37. So installs that have to pull every image from their own registry (a private mirror, an air-gapped cluster, GCP Marketplace) can't run them, even thoughinitImageexists for exactly this.What changes:
wait-for-apparmoron both executors now usesretool.initImage, like theinstall-seccompinit containers next to it.retool.initImagewhencodeExecutor.appArmorInstallerImageis unset. That override still wins.image.pullSecrets, like the executors, so aninitImagein a registry that needs credentials can be pulled on every node. Before this PR the installer only ever pulled public Docker Hub busybox.initImagecomment invalues.yamllists the new users.Defaults render the same pinned
busybox:1.37.0@sha256:b3255e7d.... The DaemonSet's default moves from unpinnedbusybox:1.37to that pinned image. The agent sandbox'swait-for-apparmoralready usesrr.agentSandbox.initImageand is unchanged.Verified
.github/test_apparmor_images.py, wired intoci.yaml, checks four things: the defaults stay pinned, aninitImageoverride reaches every AppArmor container,appArmorInstallerImagestill overrides the DaemonSet, andimage.pullSecretsreaches the installer as well as the executors.helm lintandschema/generate.sh --checkpass; the twovalues.yamlfiles are in sync.