Repository navigation
executor/k8s: Restore replicas, add Kubernetes client limits and job ephemeral storage - #1029
Draft
marcleblanc2 wants to merge 3 commits into
Draft
marcleblanc2 wants to merge 3 commits into
marcleblanc2 wants to merge 3 commits into
Conversation
…ephemeral storage The chart hardcoded replicas: 1 with a comment saying executor pods pin job pods to their node and contend for a ReadWriteOnce PVC. Neither is true: the chart never sets EXECUTOR_KUBERNETES_NODE_NAME by default, and #911 removed that PVC. Executors dequeue with SKIP LOCKED, have unique names, and give each job its own pod and workspace volume, so several executor pods can serve the same queues. - executor.replicas, default 1 - executor.kubernetesClient.qps / burst, rendered only when set, for EXECUTOR_KUBERNETES_CLIENT_QPS / BURST - executor.kubernetesJob.resources.{requests,limits}.ephemeralStorage, rendered only when set Amp-Thread-ID: https://ampcode.com/threads/T-01a20ade-0ba8-7364-b673-ac2197c102c9 Co-authored-by: Amp <amp@ampcode.com>
Tolerations, node affinity, and pod affinity values now accept YAML lists, rendered as JSON. Escaped JSON strings still work. Add kubernetesJob.podSecurityContext and containerSecurityContext, which set KUBERNETES_EXECUTOR_POD_SECURITY_CONTEXT and KUBERNETES_EXECUTOR_CONTAINER_SECURITY_CONTEXT, so job pods can run in Pod Security Admission restricted namespaces. Amp-Thread-ID: https://ampcode.com/threads/T-01a20ade-0ba8-7364-b673-ac2197c102c9 Co-authored-by: Amp <amp@ampcode.com>
…n CHANGELOG Amp-Thread-ID: https://ampcode.com/threads/T-01a20ade-0ba8-7364-b673-ac2197c102c9 Co-authored-by: Amp <amp@ampcode.com>
This branch has not been deployed
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 Kubernetes-native executor chart hardcodes
replicas: 1, with a comment saying executor pods pin job pods to their own node and contend for a ReadWriteOnce PVC. Neither is true:EXECUTOR_KUBERNETES_NODE_NAMEby default.Executors dequeue with
SKIP LOCKED, have unique names, and give each job its own pod and workspace volume, so several executor pods can serve the same queues.Solution
executor.replicas, default1executor.kubernetesClient.qpsandburst, which setEXECUTOR_KUBERNETES_CLIENT_QPSand_BURST, and render only when set, so the executor's defaults applyexecutor.kubernetesJob.resources.requests.ephemeralStorageandlimits.ephemeralStorage, which render only when setexecutor.kubernetesJob.podSecurityContextandcontainerSecurityContext, as YAML, which setKUBERNETES_EXECUTOR_POD_SECURITY_CONTEXTandKUBERNETES_EXECUTOR_CONTAINER_SECURITY_CONTEXT, so job pods can run in Pod Security Admissionrestrictednamespaces. The executor has read both since 7.3; the chart had no way to set them exceptextraEnv.executor.kubernetesJob.node.tolerations,requiredAffinityMatchExpressions,requiredAffinityMatchFields,pod.affinity, andpod.antiAffinitynow accept YAML lists, rendered withtoJson. Before, the ConfigMap wrapped these strings in double quotes without escaping, so plain JSON failed to render (did not find expected key) and customers had to backslash-escape every quote. Escaped strings still render the same.Older executor images ignore the new environment variables.
Testing
helm unittest charts/sourcegraph-executor/k8s(12 passed)[]corev1.Toleration,[]corev1.NodeSelectorRequirement,[]corev1.PodAffinityTerm,corev1.PodSecurityContext,corev1.SecurityContext) with unknown fields disallowed: all parse. An old escaped-string override renders and parses unchanged.Linked PRs
Amp threads