Skip to content

Conversation

@kaznak
Copy link

@kaznak kaznak commented Nov 10, 2025

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

The kube-thanos-compact-default-params.libsonnet file already defines a securityContextContainer parameter, but it is not currently used.

securityContextContainer:: {
runAsUser: defaults.securityContext.runAsUser,
runAsGroup: defaults.securityContext.runAsGroup,
runAsNonRoot: defaults.securityContext.runAsNonRoot,
seccompProfile: defaults.securityContext.seccompProfile,
allowPrivilegeEscalation: false,
readOnlyRootFilesystem: true,
capabilities: { drop: ['ALL'] },
},

Because of this missing reference, the generated manifests trigger Pod Security Admission warnings or may even be rejected under restricted policies.

This PR applies the securityContextContainer parameter to the compact container so that the generated manifests comply with restricted PodSecurity standards.

Verification

I applied the manifests generated from this branch to my cluster, and the Pod Security Admission warning was successfully suppressed.

kaznak added a commit to kaznak/kube-thanos that referenced this pull request Nov 10, 2025
kaznak added a commit to kaznak/kube-thanos that referenced this pull request Nov 10, 2025
@kaznak kaznak changed the title compact: Add securityContext to Thanos compact container of the StatefulSets compact: Add securityContext to Thanos compact container Nov 10, 2025
@kaznak kaznak force-pushed the fix/compactor-use-securitycontextcontainer branch from 3e729af to ee89f75 Compare November 10, 2025 06:21
@kaznak kaznak marked this pull request as ready for review November 10, 2025 06:23
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.

1 participant