Skip to content

Adding sidecar image param to the k8 worker #45

Merged
ianhodge merged 1 commit intomainfrom
04-07-ian_adding_sidecar_image_param
Apr 7, 2026
Merged

Adding sidecar image param to the k8 worker #45
ianhodge merged 1 commit intomainfrom
04-07-ian_adding_sidecar_image_param

Conversation

@ianhodge
Copy link
Copy Markdown
Member

@ianhodge ianhodge commented Apr 7, 2026

Add sidecar_image config override to Kubernetes backend

Problem

Customers running EKS in restricted network zones cannot pull the sidecar image (docker.io/warpdotdev/warp-agent:latest) directly from Docker Hub. The sidecar image reference is sent by the server in each task assignment and injected as an init container in the Kubernetes Job. There is currently no way to override this to point at an internal mirror (e.g. an ECR pull-through cache).

Solution

Add a new sidecar_image config field to the Kubernetes backend. When set, it replaces the server-provided sidecar image reference for the warp-agent sidecar (mounted at /agent).

Precedence: config sidecar_image > server-provided image (same pattern as preflight_image).

Changes

  • Config layer: Added sidecar_image field to KubernetesConfig and KubernetesBackendConfig with no_whitespace validation
  • Override logic: prepareTaskParams in worker.go uses the config override when set, with an info log noting the substitution
  • Helm chart: Added kubernetesBackend.sidecarImage value and conditional configmap emission
  • Tests: Config parsing tests (valid, empty, whitespace rejection) + prepareTaskParams override tests (override wins, server fallback, no sidecar when server sends empty)
  • README: Documented the field with two callouts:
    • Tag pinning risk: Customer is responsible for keeping their mirror in sync
    • Scope: Only overrides the warp-agent sidecar, not additional sidecars

Example config

backend:
  kubernetes:
    sidecar_image: "123456789012.dkr.ecr.us-east-1.amazonaws.com/docker-hub/warpdotdev/warp-agent:latest"

Oz conversation | Plan

Co-Authored-By: Oz oz-agent@warp.dev

Copy link
Copy Markdown
Member Author

ianhodge commented Apr 7, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ianhodge ianhodge requested a review from bnavetta April 7, 2026 17:06
@ianhodge ianhodge changed the title ian/adding_sidecar_image_param Adding sidecar image param to the k8 worker Apr 7, 2026
@ianhodge ianhodge marked this pull request as ready for review April 7, 2026 17:06
@ianhodge ianhodge force-pushed the 04-07-ian_adding_sidecar_image_param branch from ab0fc15 to b359b0f Compare April 7, 2026 17:08
Comment thread internal/worker/worker.go
var sidecars []types.SidecarMount
if assignment.SidecarImage != "" {
sidecarImage := assignment.SidecarImage
if w.config.Kubernetes != nil && w.config.Kubernetes.SidecarImage != "" {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking, but should we support this for the Docker backend as well?

@ianhodge ianhodge merged commit 8dbc3a8 into main Apr 7, 2026
6 checks passed
@ianhodge ianhodge deleted the 04-07-ian_adding_sidecar_image_param branch April 7, 2026 17:12
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.

2 participants