Skip to content

fix: propagate container resources to version-probe job#134

Open
Milias wants to merge 1 commit intoClickHouse:mainfrom
Milias:fix/version-probe-resources
Open

fix: propagate container resources to version-probe job#134
Milias wants to merge 1 commit intoClickHouse:mainfrom
Milias:fix/version-probe-resources

Conversation

@Milias
Copy link

@Milias Milias commented Mar 16, 2026

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 buildVersionProbeJob function copies Image, ImagePullPolicy, SecurityContext, and Command from ContainerTemplate but omits the Resources field. 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.Resources to the probe container spec in buildVersionProbeJob, 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.

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 GrigoryPervakov self-assigned this Mar 16, 2026
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