Repository navigation
Create global container and pod security context configs - #818
Open
marcleblanc2 wants to merge 1 commit into
Open
marcleblanc2 wants to merge 1 commit into
marcleblanc2 wants to merge 1 commit into
Conversation
michaellzc
force-pushed
the
marc/global-security-context
branch
from
February 18, 2026 00:52
26ba364 to
7a23a3a
Compare
marcleblanc2
force-pushed
the
marc/global-security-context
branch
from
October 30, 2026 22:00
7a23a3a to
8d667bc
Compare
Add .Values.sourcegraph.containerSecurityContext and .Values.sourcegraph.podSecurityContext so customers (e.g. OpenShift) can set runAsUser / runAsGroup / fsGroup once for every container and pod. Rename each component's shipped defaults to defaultContainerSecurityContext / defaultPodSecurityContext and add empty containerSecurityContext / podSecurityContext override keys. Templates render the 3-tier merge (component default -> global -> component override) through shared helpers in templates/_helpers/_securityContext.tpl, copied into all four charts. - precise-code-intel-worker derives fsGroup from the merged container runAsGroup - cadvisor gates /dev/kmsg on the merged privileged value - k8s executor keeps the deprecated executor.securityContext pod fallback - dind executor keeps dind.gVisor.securityContext as a full replacement - otel-agent and otel-collector pods gain pod security context keys Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a18eb0-b6fb-7675-8f04-2fc05d2fe567
marcleblanc2
force-pushed
the
marc/global-security-context
branch
from
October 30, 2026 22:46
8d667bc to
4e71e8e
Compare
This branch has not been deployed
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.
Problem:
containerSecurityContextand / orpodSecurityContext, they generally need to modify the same on all containers or all podsrunAsUser,runAsGroup, andfsGroupon all containers / pods to the same UID / GID assigned to their Kubernetes namespace (OpenShift Project)Solution:
.Values.sourcegraph.containerSecurityContextand.Values.sourcegraph.podSecurityContext, so customers can set the global configs in one place, and if set, override our defaultscontainerSecurityContextandpodSecurityContexttodefaultContainerSecurityContextanddefaultPodSecurityContext, and created emptycontainerSecurityContextandpodSecurityContextkeys, so customers who already define overrides for these will continue as-is, without change, and this allows customers to set both the global configs to override our defaults, and override specific configs for specific pods / containers.Linear issue FEIE-301: Usability: Create instance-wide config for default podSecurityContext and containerSecurityContext
Checklist
Test plan
helm unittestandhelm lintpass, for all 4 chartsTested with helm template commands and compared diffs, using: