feat(chart): add support for additional init containers #1171
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.
This PR adds the ability to add additional init containers in front of spegel's own configuration init container to perform more host-related initialization via Helm values.
Since GKE is not officially supported by spegel as of right now (https://spegel.dev/docs/getting-started/#gke), we made it work with the host's containerd config by patching the host's config files from another daemonset during node startup. However, this provides inherent possibility of race conditions between spegel and that patch step, where the spegel pod on the node starts before the containerd config is fully patched, sending spegel into a crashloop until the patch is completed.
We want to resolve this by getting rid of the race condition by patching the containerd configuration before spegel starts, thus injecting additional init containers seems to be the easiest solution.
In addition, here's how to make GKE (with ContainerOS) work with spegel:
The rest of the daemonset is omitted for brevity. The customized configuration is persistent during the node's lifecycle.
The script can probably be adjusted to use less privileges and work with a hostPath mount instead of relying on
nsenter, but for the time being, this works for us. If you'd like to add this to the "GKE Support" section, feel free to do so.