Skip to content

[Bug]: Kubernetes runs keep failing after the jump pod is evicted #4407

Closed

Description

@peterschmidt85

Steps to reproduce

  1. Configure a kubernetes backend with proxy_jump set (we used a k3s cluster).

  2. Create a fleet on it and run a service with retry:

    type: fleet
    name: dev
    nodes: 0..4
    backends: [kubernetes]
    type: service
    name: web
    image: python:3.12-slim
    commands:
      - python -m http.server 8000
    port: 8000
    fleets: [dev]
    retry:
      on_events: [no-capacity, interruption, error]
      duration: 1d
  3. While the service runs, have the jump pod (dstack-main-ssh-jump-pod) evicted, e.g. by memory or disk pressure on its node.

Actual behaviour

The service becomes unreachable, and every new attempt fails within seconds with waiting instance limit exceeded. The server logs Jump pod dstack-main-ssh-jump-pod is unexpectedly finished. With retry, this repeats until someone deletes the pod.

dstack reuses the existing jump pod without checking whether it's still running, so once it has been evicted, it's never recreated. The jump pod has no resource requests, so it's the first pod Kubernetes evicts when a node runs low on memory or disk.

Expected behaviour

dstack recreates the jump pod on the next attempt, and the service starts.

dstack version

0.22.5 and master (0f6db9d)

Notes

Affects the kubernetes backend only.

On dstack Sky, this hit a project running four services on its own k3s cluster. On Oct 23, around 13:13 UTC, its jump pod stopped (the reason wasn't captured), and dstack lost SSH access to every pod in the cluster. From 13:21, every retry of the four services failed this way, about 1,500 failed attempts an hour, and they were still failing a day later.

Suggested fix: recreate the jump pod if it's finished when a job is provisioned, waiting for the old pod to be deleted before creating the new one.

Tip

Workaround: delete the jump pod; dstack recreates it when it provisions the next job in the cluster, e.g. on the service's next retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions