Skip to content

Commit 314f8f2

Browse files
authored
test(e2e): land per-PR worker pods on the default nodepool (#746)
* test(e2e): land per-PR worker pods on the default nodepool The per-PR harness Job, control plane, and config store already run on the default (untainted) nodepool; only the CP-spawned worker pods were pinned to the real dev deployment's duckgres-workers pool. That made every PR's worker churn (cold bursts, sized spawns, TTL reaps) fight the dev deployment's headroom placeholders and Karpenter consolidation on the production-shaped pool. Point the e2e CP's worker nodeSelector at the default pool instead and drop the now-unneeded taint toleration. The worker image is arm64-only and the default pool is mixed-arch, so the selector pins kubernetes.io/arch=arm64 rather than going selector-less. * test(e2e): align CP env knobs with prod-us logic Same knobs as the prod-us chart render (values differ, the logic matches): - add DUCKGRES_WORKER_QUEUE_TIMEOUT=5m (prod 5m; the binary default 60s is too tight for an on-demand cold spawn that needs a fresh node — previously observed flaking the sized-worker assertions) - add DUCKGRES_K8S_MAX_WORKERS=50 (prod sets an explicit cap; unset, the binary derives one from the CP pod's 1Gi memory) - drop DUCKGRES_K8S_WORKER_MAX_TTL (prod does not set a TTL clamp) Deliberate divergences documented in-file: WORKER_PRIORITY_CLASS (prod's 1000000 class would let per-PR worker bursts preempt unrelated default-pool workloads), CACHE_ENABLED (cache-proxy DaemonSet only runs on duckgres-workers nodes), wildcard TLS + TRINO_* (need cert-manager / a Trino cluster in the per-PR namespace). * test(e2e): correct maxWorkers comment (k8s unset = unbounded, not CP-memory-derived)
1 parent ae90f23 commit 314f8f2

2 files changed

Lines changed: 27 additions & 6 deletions

File tree

tests/e2e-mw-dev/harness.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ graceful_drain() { # org password
736736
# whole pod's resources and a heavy query can't be starved by a co-resident one.
737737
# Regression net: if a worker were ever shared (pre-change least-loaded sharing),
738738
# the org would peak at a single active-org-labeled pod for both queries.
739-
# Assumes the worker nodepool is already warm (prior resilience steps spawned
739+
# Assumes the default nodepool already has warm capacity (prior resilience steps spawned
740740
# pods), so the second pod schedules within the queries' runtime.
741741
one_session_per_worker() { # org password
742742
log "one session per worker: concurrent queries land on distinct pods on $1"

tests/e2e-mw-dev/manifests.tmpl.yaml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,35 @@ spec:
249249
- { name: DUCKGRES_K8S_WORKER_PROFILE_MAX_CPU, value: "8" }
250250
- { name: DUCKGRES_K8S_WORKER_PROFILE_MIN_MEMORY, value: "2Gi" }
251251
- { name: DUCKGRES_K8S_WORKER_PROFILE_MAX_MEMORY, value: "16Gi" }
252-
- { name: DUCKGRES_K8S_WORKER_MAX_TTL, value: "24h" }
252+
# Prod-logic parity (sizes differ, the knobs match prod-us):
253+
# - workerQueueTimeout bounds how long a connection waits for its
254+
# on-demand cold spawn (binary default 60s is too tight for a
255+
# fresh Karpenter node — observed flaking the sized assertions).
256+
# - an explicit worker cap, like prod's maxWorkers (unset = unbounded
257+
# for the k8s backend; the nodepool is the only ceiling).
258+
# Deliberately NOT aligned with prod:
259+
# - DUCKGRES_K8S_WORKER_PRIORITY_CLASS: e2e workers run on the
260+
# shared default nodepool — prod's 1000000 PriorityClass would let
261+
# per-PR worker bursts preempt unrelated workloads there.
262+
# - DUCKGRES_CACHE_ENABLED: the cache-proxy DaemonSet only runs on
263+
# duckgres-workers nodes; default-pool workers would dial a
264+
# nonexistent hostPort proxy.
265+
# - DUCKGRES_CERT/_KEY (wildcard TLS) and DUCKGRES_TRINO_*: need
266+
# cert-manager / a Trino cluster in the per-PR namespace; the CP
267+
# serves its self-signed cert and Trino is not under e2e.
268+
- { name: DUCKGRES_WORKER_QUEUE_TIMEOUT, value: "5m" }
269+
- { name: DUCKGRES_K8S_MAX_WORKERS, value: "50" }
253270
- name: DUCKGRES_INTERNAL_SECRET
254271
valueFrom: { secretKeyRef: { name: duckgres-tokens, key: internal-secret } }
255272
- { name: DUCKGRES_AWS_REGION, value: "us-east-1" }
256-
# Land workers on the dedicated worker nodepool (mw-dev arm64).
257-
- { name: DUCKGRES_K8S_WORKER_NODE_SELECTOR, value: '{"posthog.com/nodepool":"duckgres-workers"}' }
258-
- { name: DUCKGRES_K8S_WORKER_TOLERATION_KEY, value: "posthog.com/nodepool" }
259-
- { name: DUCKGRES_K8S_WORKER_TOLERATION_VALUE, value: "duckgres-workers" }
273+
# Land e2e workers on the DEFAULT (untainted) nodepool, NOT the real
274+
# deployment's duckgres-workers pool: per-PR worker churn must not
275+
# fight the dev deployment's headroom placeholders / Karpenter
276+
# consolidation on the production-shaped pool, and the harness Job /
277+
# per-PR CP / config-store already run on the default pool. The
278+
# worker image is arm64-only and the default pool is mixed-arch, so
279+
# pin the arch (no toleration needed — the default pool is untainted).
280+
- { name: DUCKGRES_K8S_WORKER_NODE_SELECTOR, value: '{"kubernetes.io/arch":"arm64"}' }
260281
# Provision real per-org Lakekeeper instances (iceberg path).
261282
- { name: DUCKGRES_LAKEKEEPER_PROVISIONER_ENABLED, value: "true" }
262283
# Org identity is resolved from the TLS SNI hostname

0 commit comments

Comments
 (0)