Skip to content

feat: add runAsUser and runAsGroup to executor #632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/sourcegraph-executor/k8s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ In addition to the documented values, the `executor` and `private-docker-registr
| executor.queueName | string | `""` | The name of the queue to pull jobs from to. Possible values: batches and codeintel. **Either this or queueNames is required.** |
| executor.queueNames | list | `[]` | The names of multiple queues to pull jobs from to. Possible values: batches and codeintel. **Either this or queueName is required.** |
| executor.replicas | int | `1` | |
| executor.securityContext | object | `{"fsGroup":null,"privileged":false,"runAsGroup":null,"runAsUser":null}` | The containerSecurityContext for the executor image |
| executor.storageSize | string | `"10Gi"` | The storage size of the PVC attached to the executor deployment. |
| executor.tolerations | list | `[]` | Tolerations, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
| sourcegraph.affinity | object | `{}` | Affinity, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ spec:
{{- include "executor.labels" . | nindent 8 }}
spec:
securityContext:
fsGroup: {{ .Values.executor.kubernetesJob.fsGroup }}
fsGroup: {{ .Values.executor.securityContext.fsGroup }}
runAsUser: {{ .Values.executor.securityContext.runAsUser }}
runAsGroup: {{ .Values.executor.securityContext.runAsGroup }}
serviceAccountName: sg-executor
containers:
- name: executor
image: {{ include "sourcegraph.image" (list . "executor") }}
imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }}
securityContext:
privileged: {{ .Values.executor.securityContext.privileged }}
ports:
- containerPort: 6060
name: debug
Expand Down
10 changes: 10 additions & 0 deletions charts/sourcegraph-executor/k8s/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ executor:
namespace: "default"
# -- The path to the kubeconfig file. If not specified, the in-cluster config is used.
kubeconfigPath: ""
# -- The containerSecurityContext for the executor image
securityContext:
# @default -- nil; accepts [0, 2147483647]
runAsUser:
# @default -- nil; accepts [0, 2147483647]
runAsGroup:
# @default -- nil; accepts [0, 2147483647]
fsGroup:
# @default -- false; accepts [true, false]
privileged: false

kubernetesJob:
# -- The number of seconds after which a Kubernetes job will be terminated.
Expand Down
Loading