Repository navigation
executors/k8s: Remove the unused /data PVC and the job pod affinity - #519
Draft
marcleblanc2 wants to merge 1 commit into
Draft
marcleblanc2 wants to merge 1 commit into
marcleblanc2 wants to merge 1 commit into
Conversation
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>
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
The native Kubernetes executor component has three leftovers from the executor's removed multi-pod job mode:
/data, which a second replica on another node can't attach, so the Deployment can't scale past one pod.EXECUTOR_KUBERNETES_PERSISTENCE_VOLUME_NAME, which the executor no longer reads.EXECUTOR_KUBERNETES_POD_AFFINITYso 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 --prunedeletes thesg-executor-pvcPVC, which holds onlylost+found. Customers who relied on job pods staying on executor nodes can setEXECUTOR_KUBERNETES_NODE_SELECTORor the affinity env var in their overlay.Testing
kubectl kustomize examples/executorsrenders with nosg-executor-pvcand no job pod affinity.Linked PRs
Amp threads