Background
The Kubernetes Job launcher creates a headless Service to provide stable DNS names for indexed Pods. Job cleanup deletes only the Job; the separate Service has no ownerReferences and survives indefinitely with its generated EndpointSlice. Repeated executions therefore accumulate Kubernetes API objects until cluster-wide informer caches can exhaust memory. This reproduces on Kubernetes 1.34 for Job-backed executions.
Acceptance Criteria
Additional Context
Reproduction
- Launch a Job-backed container execution.
- Allow the execution to complete and run launcher cleanup.
- Observe that the
Job is deleted but its same-named headless Service remains.
Expected behavior: deleting or cleaning up the Job also removes the headless Service and generated EndpointSlice.
Proposed fix: #368
Background
The Kubernetes Job launcher creates a headless
Serviceto provide stable DNS names for indexed Pods. Job cleanup deletes only theJob; the separateServicehas noownerReferencesand survives indefinitely with its generatedEndpointSlice. Repeated executions therefore accumulate Kubernetes API objects until cluster-wide informer caches can exhaust memory. This reproduces on Kubernetes 1.34 for Job-backed executions.Acceptance Criteria
Additional Context
Reproduction
Jobis deleted but its same-named headlessServiceremains.Expected behavior: deleting or cleaning up the
Jobalso removes the headlessServiceand generatedEndpointSlice.Proposed fix: #368