Skip to content

executors/k8s: Remove the unused /data PVC and the job pod affinity - #519

Draft
marcleblanc2 wants to merge 1 commit into
mainfrom
marc/executor-k8s-remove-pvc
Draft

marcleblanc2 wants to merge 1 commit into
mainfrom
marc/executor-k8s-remove-pvc

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The native Kubernetes executor component has three leftovers from the executor's removed multi-pod job mode:

  • It mounts a 100Gi ReadWriteOnce PVC at /data, which a second replica on another node can't attach, so the Deployment can't scale past one pod.
  • It sets EXECUTOR_KUBERNETES_PERSISTENCE_VOLUME_NAME, which the executor no longer reads.
  • It sets EXECUTOR_KUBERNETES_POD_AFFINITY so every job pod lands on a node running an executor pod, which caps job pods at what those nodes hold.

Each job pod now has its own workspace volume, and the executor writes nothing to /data.

Solution

Remove the PVC, its volume and mount, the dead env var, and the pod affinity. Job pods then schedule on any suitable node, and the Deployment can be scaled. This is the same PVC change the Helm chart made in sourcegraph/deploy-sourcegraph-helm#911.

On upgrade, kubectl apply --prune deletes the sg-executor-pvc PVC, which holds only lost+found. Customers who relied on job pods staying on executor nodes can set EXECUTOR_KUBERNETES_NODE_SELECTOR or the affinity env var in their overlay.

Testing

  • kubectl kustomize examples/executors renders with no sg-executor-pvc and no job pod affinity.

Linked PRs

Amp threads

The native Kubernetes executor component mounted a 100Gi ReadWriteOnce
PVC at /data and set EXECUTOR_KUBERNETES_PERSISTENCE_VOLUME_NAME, left
over from the multi-pod job mode the executor no longer has: each job
pod now has its own emptyDir or per-job PVC workspace, and the executor
writes nothing to /data. The PVC kept the Deployment from scaling past
one replica (a second pod on another node cannot attach it), and
EXECUTOR_KUBERNETES_POD_AFFINITY pinned every job pod to a node running
an executor pod, which capped how many job pods could run.

Remove the PVC, its volume and mount, the dead env var, and the pod
affinity, so job pods schedule on any suitable node and the Deployment
can be scaled. The Helm chart made the same PVC change in
sourcegraph/deploy-sourcegraph-helm#911.

Amp-Thread-ID: https://ampcode.com/threads/T-01a20ade-0ba8-7364-b673-ac2197c102c9
Co-authored-by: Amp <amp@ampcode.com>
@github-actions

Copy link
Copy Markdown

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