Skip to content

Commit 5fff990

Browse files
committed
fix up
1 parent e637b80 commit 5fff990

4 files changed

Lines changed: 39 additions & 1 deletion

File tree

charts/sourcegraph-executor/dind/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ In addition to the documented values, the `executor` and `private-docker-registr
5858

5959
| Key | Type | Default | Description |
6060
|-----|------|---------|-------------|
61+
| dind.command | list | `["dockerd"]` | Command for the dind container. |
6162
| 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 |
63+
| 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. |
6264
| 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. |
6365
| 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+
| 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. |
6467
| dind.image.registry | string | `"index.docker.io"` | |
6568
| dind.image.repository | string | `"docker"` | |
6669
| dind.image.tag | string | `"29.5.3-dind"` | |
@@ -78,6 +81,9 @@ In addition to the documented values, the `executor` and `private-docker-registr
7881
| 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). |
7982
| executor.replicaCount | int | `1` | |
8083
| executor.resources | object | `{}` | Resource requests and limits for the executor container. Each queue can override this with its own resources field. |
84+
| executor.storage.class | string | `""` | StorageClass for the ephemeral volume. Only used when type is ephemeral. Defaults to the cluster default StorageClass when empty. |
85+
| executor.storage.size | string | `""` | Size of the scratch volume. emptyDir: sets sizeLimit (optional, leave empty for unlimited). ephemeral: sets the PVC storage request (required). |
86+
| executor.storage.type | string | `"emptyDir"` | Type of scratch volume for job workspaces. One of: emptyDir, ephemeral. emptyDir: plain emptyDir, no storage class required. ephemeral: per-pod PVC via the cluster default storage class; size is required. |
8187
| privateDockerRegistry.enabled | bool | `true` | Whether to deploy the private registry. Only one registry is needed when deploying multiple executors. More information: https://docs.sourcegraph.com/admin/executors/deploy_executors#using-private-registries |
8288
| privateDockerRegistry.image.registry | string | `"index.docker.io"` | |
8389
| privateDockerRegistry.image.repository | string | `"registry"` | |

charts/sourcegraph-executor/dind/examples/gcp/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ executor:
99
queueNames: ["batches", "codeintel"]
1010
log:
1111
format: "json_gcp"
12+
storage:
13+
type: ephemeral
14+
size: 50Gi
15+
class: premium-rwo
1216

1317
dind:
1418
# enable gVisor to run executor instances on GKE Sandbox

charts/sourcegraph-executor/dind/templates/_helpers.tpl

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,23 @@ spec:
330330
{{- end }}
331331
volumes:
332332
- name: executor-scratch
333-
emptyDir: {}
333+
{{- if eq $r.Values.executor.storage.type "ephemeral" }}
334+
ephemeral:
335+
volumeClaimTemplate:
336+
spec:
337+
accessModes: ["ReadWriteOnce"]
338+
{{- if $r.Values.executor.storage.class }}
339+
storageClassName: {{ $r.Values.executor.storage.class }}
340+
{{- end }}
341+
resources:
342+
requests:
343+
storage: {{ required "executor.storage.size is required when storage.type is ephemeral" $r.Values.executor.storage.size }}
344+
{{- else }}
345+
emptyDir:
346+
{{- if $r.Values.executor.storage.size }}
347+
sizeLimit: {{ $r.Values.executor.storage.size }}
348+
{{- end }}
349+
{{- end }}
334350
- name: docker-config
335351
configMap:
336352
defaultMode: 420

charts/sourcegraph-executor/dind/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,18 @@ executor:
119119
# EXECUTOR_MAXIMUM_NUM_JOBS, EXECUTOR_MAXIMUM_RUNTIME_PER_JOB,
120120
# EXECUTOR_DOCKER_ADD_HOST_GATEWAY, EXECUTOR_KEEP_WORKSPACES).
121121
env: {}
122+
storage:
123+
# -- Type of scratch volume for job workspaces. One of: emptyDir, ephemeral.
124+
# emptyDir: plain emptyDir, no storage class required.
125+
# ephemeral: per-pod PVC via the cluster default storage class; size is required.
126+
type: emptyDir
127+
# -- Size of the scratch volume.
128+
# emptyDir: sets sizeLimit (optional, leave empty for unlimited).
129+
# ephemeral: sets the PVC storage request (required).
130+
size: ""
131+
# -- StorageClass for the ephemeral volume. Only used when type is ephemeral.
132+
# Defaults to the cluster default StorageClass when empty.
133+
class: ""
122134

123135
dind:
124136
image:

0 commit comments

Comments
 (0)