Skip to content

feat: annotate hook/ingester Job pods safe-to-evict=false so node consolidation never kills a long run #211

Description

@rorybyrne

Context

When an OSA deployment runs on a Kubernetes cluster with the cluster-autoscaler, scale-down/consolidation may evict any pod to drain an underused node. Hook Jobs routinely run for many minutes up to their timeout (an hour by default) at high CPU; an eviction 50 minutes in throws all that work away and burns a retry attempt — the run limps instead of failing fast or finishing.

Ask

Add the standard opt-out annotation to the pod templates the K8s runners create (infra.k8s.runner hook Jobs, infra.k8s.ingester_runner ingester Jobs):

metadata:
  annotations:
    cluster-autoscaler.kubernetes.io/safe-to-evict: "false"

This tells the autoscaler the pod must not be evicted for consolidation; the node it runs on is only reclaimed once the Job finishes. It is a no-op on clusters without an autoscaler, so it is safe unconditionally — no configuration surface needed.

Notes

  • Annotation belongs on the pod template inside the Job spec, not the Job object.
  • Worth a quick sweep for other runner-created pods with meaningful in-flight state; the OSA server's own Deployment pods should NOT get it (they are replicated and must stay evictable for drains).

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions