About this scenario
The export Job runs a log shipper as a second container next to the exporter. The exporter is done in a few seconds, but the shipper never exits, so the Pod stays Running and the Job never completes.
Native sidecars are stable since Kubernetes 1.33: an init container with restartPolicy: Always starts before the main containers, runs next to them, and is stopped once they finish. Turn the shipper into one.
Objectives
- See why the Job never completes
- Make log-shipper a native sidecar
- The export Job completes
What you'll practice
- A second container that never exits keeps a Job's Pod running, so the Job never completes. Native sidecars, alpha in 1.28 and stable in 1.33, fix that.
- A native sidecar is an init container with
restartPolicy: Always. It starts before the main containers, keeps running (and restarting) next to them, and doesn't block the Pod from finishing. - When a Job Pod's main containers finish, the kubelet stops its sidecars. A sidecar that ignores SIGTERM holds the Pod until
terminationGracePeriodSeconds runs out. - kubectl counts sidecars in the READY column, and the scheduler adds their requests to the Pod's.
How the playground works
The cluster runs entirely in your browser: a simulated API server, scheduler, kubelets and controllers, with virtual nodes in three zones. kubectl output follows the real formats, errors use the real messages, and the add-ons (CSI storage, Traefik, Envoy Gateway, cert-manager, Flux, Argo CD) behave like their real counterparts for the common paths. It's a simulation, so some behavior is simplified. Your progress is saved in this browser.