CertGrid CertGrid
Concepts·Certified Kubernetes Administrator

Sidecar Containers

An init container with restartPolicy: Always is not an init container. It keeps running beside the main container - started=true and ready=true at the same instant - and it lives in the initContainers list anyway.

Workloads Guide 32 of 103 Intermediate

Four nodes, though nothing here depends on placement - both pods land wherever the scheduler puts them.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

This guide includes

Use this when a helper container has to be running before the app starts and stay running beside it. This matters because one line - restartPolicy: Always on an init container - turns it into a sidecar with guarantees an ordinary container in the same Pod does not get.

Before you start

  1. An init container finishes

  2. One line changes what it is

  3. Why it was worth a new feature

Official sources