fix: propagate container resources to version-probe job#134
Open
Milias wants to merge 1 commit intoClickHouse:mainfrom
Open
fix: propagate container resources to version-probe job#134Milias wants to merge 1 commit intoClickHouse:mainfrom
Milias wants to merge 1 commit intoClickHouse:mainfrom
Conversation
The buildVersionProbeJob function copies Image, ImagePullPolicy, SecurityContext, and Command from ContainerTemplate but omits Resources. This causes version-probe pods to lack CPU/memory requests, which triggers rejection by admission controllers that require resource requests (e.g. Gatekeeper). Add Resources field to the probe container spec, matching the pattern already used in ClickHouse and Keeper StatefulSet container builders. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GrigoryPervakov
approved these changes
Mar 16, 2026
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.
Hello!
I was trying out the operator and found a minor limitation: probe pods don't have resources defined. In the clusters I work with there is an admission webhook that blocks this. This PR just adds those resources.
I run tests (at least as many as I could) locally.
Please let me know if you'd like anything changed!
Thanks a lot :)
Claude-generated from here
Why
The
buildVersionProbeJobfunction copies Image, ImagePullPolicy, SecurityContext, and Command fromContainerTemplatebut omits theResourcesfield. This causes version-probe pods to lack CPU/memory requests, which triggers rejection by admission controllers that require resource requests (e.g. Gatekeeper/OPA).What
Added
Resources: cfg.ContainerTemplate.Resourcesto the probe container spec inbuildVersionProbeJob, matching the pattern already used in both ClickHouse (templates.go:439) and Keeper (templates.go:514) StatefulSet container builders.Added a test assertion verifying the version-probe Job container has non-zero resources.
Related Issues
Related to resource enforcement by admission controllers on version-probe Jobs.