You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8d667bc
Browse filesBrowse the repository at this point in the historyBrowse files
Create global container and pod security context configs
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
Amp-Thread-ID: https://ampcode.com/threads/T-01a18eb0-b6fb-7675-8f04-2fc05d2fe567
Co-authored-by: Amp <amp@ampcode.com>
Copy file name to clipboardExpand all lines: charts/sourcegraph-executor/dind/README.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,14 +59,19 @@ In addition to the documented values, the `executor` and `private-docker-registr
59
59
| Key | Type | Default | Description |
60
60
|-----|------|---------|-------------|
61
61
| dind.command | list |`["dockerd"]`| Command for the dind container. |
62
+
| dind.containerSecurityContext | object |`{}`| Override container security context for the dind container. Ignored when gVisor is enabled. |
62
63
| dind.daemonConfig | object |`{"hosts":["tcp://127.0.0.1:2375"],"insecure-registries":["private-docker-registry:5000"],"mtu":1200,"registry-mirrors":["http://private-docker-registry:5000"],"tls":false}`| Docker daemon configuration passed as daemon.json to the dind sidecar. Learn more from: https://docs.docker.com/reference/cli/dockerd/#on-linux|
64
+
| dind.defaultContainerSecurityContext | object |`{"privileged":true}`| Default container security context for the dind container. Ignored when gVisor is enabled. |
63
65
| dind.gVisor.command | list | `["/bin/sh","-c","ip link del docker0 2>/dev/null || true\necho 1 > /proc/sys/net/ipv4/ip_forward\ndev=$(ip route show default | awk '{for(i=1;i<=NF;i++) if($i==\"dev\"){print $(i+1); exit}}')\naddr=$(ip addr show dev \"$dev\"| awk '/inet /{gsub(/\\/.*/, \"\", $2); print $2; exit}')\niptables-legacy -t nat -A POSTROUTING -o \"$dev\" -j SNAT --to-source \"$addr\" -p tcp || true\niptables-legacy -t nat -A POSTROUTING -o \"$dev\" -j SNAT --to-source \"$addr\" -p udp || true\nexec dockerd\n"]` | Command for the dind container when gVisor is enabled. Overrides dind.command. Prepares the network environment that gVisor does not initialise automatically before handing off to dockerd. |
64
66
| dind.gVisor.daemonConfig | object |`{"features":{"containerd-snapshotter":false},"ip6tables":false,"iptables":false,"storage-driver":"vfs"}`| Extra daemon.json settings merged into dind.daemonConfig when gVisor is enabled. These defaults configure Docker to work within gVisor's kernel constraints. |
65
67
| dind.gVisor.enabled | bool |`false`| Enable gVisor sandbox (GKE only). Requires the GKE node pool to have sandbox type set to gvisor. When enabled, sets runtimeClassName: gvisor on executor pods and replaces privileged: true with explicit capabilities — these are intercepted in-sandbox and never granted to the host kernel. See: https://gvisor.dev/docs/tutorials/docker-in-gvisor/|
66
68
| dind.gVisor.securityContext | object |`{"capabilities":{"add":["NET_ADMIN","SYS_ADMIN","AUDIT_WRITE","CHOWN","DAC_OVERRIDE","FOWNER","FSETID","KILL","MKNOD","NET_BIND_SERVICE","NET_RAW","SETFCAP","SETGID","SETPCAP","SETUID","SYS_CHROOT","SYS_PTRACE"]}}`| securityContext for the dind container when gVisor is enabled. Replaces privileged: true — gVisor intercepts these capabilities in-sandbox and never grants them to the host kernel. |
| executor.containerSecurityContext | object |`{}`| Override container security context for the executor container |
73
+
| executor.defaultContainerSecurityContext | object |`{}`| Default container security context for the executor container |
74
+
| executor.defaultPodSecurityContext | object |`{"fsGroup":101}`| Default pod security context for executor pods. fsGroup: 101 ensures the scratch volume is writable by the sourcegraph user (uid=100, gid=101) when running in Docker mode (dind). Set to {} to disable. |
70
75
| executor.env | object |`{}`| Extra environment variables to set on the executor container. |
71
76
| executor.frontendExistingSecret | string |`""`| Name of existing k8s Secret to use for frontend password. The k8s Secret must contain the key EXECUTOR_FRONTEND_PASSWORD matching the site config executors.accessToken value. frontendPassword is ignored if this is set. |
72
77
| executor.frontendPassword | string |`""`| The shared secret configured in the Sourcegraph instance site config under executors.accessToken. Required if frontendExistingSecret is not configured. |
@@ -77,7 +82,7 @@ In addition to the documented values, the `executor` and `private-docker-registr
77
82
| executor.log.level | string |`"warn"`| Possible values are dbug, info, warn, eror, crit. |
78
83
| executor.maximumNumJobs | int |`10`| The maximum amount of jobs that can be executed concurrently. |
79
84
| executor.maximumRuntimePerJob | string |`"30m"`| The maximum wall time that can be spent on a single job. |
80
-
| executor.podSecurityContext | object |`{"fsGroup":101}`|Pod-level security context applied to executor pods. fsGroup: 101 ensures the scratch volume is writable by the sourcegraph user (uid=100, gid=101) when running in Docker mode (dind). Set to {} to disable.|
85
+
| executor.podSecurityContext | object |`{}`|Override pod security context for executor pods |
81
86
| executor.queueName | string |`""`| The name of the queue to pull jobs from. Possible values: batches and codeintel. Either this or queueNames is required (when not using queues). |
82
87
| executor.queueNames | list |`[]`| The names of multiple queues to pull jobs from. Possible values: batches and codeintel. Either this or queueName is required (when not using queues). |
83
88
| executor.replicaCount | int |`1`||
@@ -93,6 +98,7 @@ In addition to the documented values, the `executor` and `private-docker-registr
| queues | list |`[]`| Optional list of queues to deploy as standalone Deployments. When set, the single executor Deployment is not rendered. Each entry supports: name (required) — used as the deployment name suffix (executor-<name>) queueName — sets EXECUTOR_QUEUE_NAME; defaults to name if omitted queueNames — sets EXECUTOR_QUEUE_NAMES (comma-joined); takes precedence over queueName when set replicaCount, resources, env (merged with executor.env, queue overrides) |
95
100
| sourcegraph.affinity | object |`{}`| Affinity, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)|
101
+
| sourcegraph.containerSecurityContext | object |`{}`| Global container security context override applied to all containers. Merges with component defaults; component-specific overrides take precedence. |
96
102
| sourcegraph.image.defaultTag | string |`"{{ .Chart.AppVersion }}"`| Global docker image tag |
| sourcegraph.image.repository | string | Sourcegraph's public Docker Hub registry | Global docker image registry or prefix |
@@ -103,6 +109,7 @@ In addition to the documented values, the `executor` and `private-docker-registr
103
109
| sourcegraph.nodeSelector | object |`{}`| NodeSelector, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector)|
104
110
| sourcegraph.podAnnotations | object |`{}`| Add extra annotations to attach to all pods |
105
111
| sourcegraph.podLabels | object |`{}`| Add extra labels to attach to all pods |
112
+
| sourcegraph.podSecurityContext | object |`{}`| Global pod security context override applied to all pods. Merges with component defaults; component-specific overrides take precedence. |
106
113
| sourcegraph.priorityClassName | string |`""`| Assign a priorityClass to all pods (daemonSets, deployments, and statefulSets) |
107
114
| sourcegraph.tolerations | list |`[]`| Tolerations, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)|
108
115
| storageClass.allowedTopologies | object |`{}`| Persistent volumes topology configuration, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/storage-classes/#allowed-topologies)|
0 commit comments