liveBook · Manning

Native sidecar

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A native sidecar container is an init container with an Always restart policy that continues running alongside a pod's main application containers.

A native sidecar is an init container configured with restartPolicy: Always. Unlike a conventional init container, it does not run to completion; it continues running alongside the pod’s main application container. section 4.2.2

Use the pattern when a pod needs a continuously running supporting container:

  • Define the supporting container under initContainers, alongside the regular containers section. section 4.2.2
  • Set restartPolicy: Always so the init container remains active instead of completing. section 4.2.2

Practice a native sidecar Deployment

Create a three-replica Deployment with a busybox native sidecar running /bin/bash sleep 1d and an nginx main container. Request 250 millicores and 600 MiB for each container, then adjust requests if the replicas do not reach Running. section 4.2.5

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Defines restart behavior and manifest placement, then stops short of deeper container-runtime internals.
Examples
Uses log reading, service-resolution waiting, kubectl output, and a busybox-plus-nginx Deployment exercise.
What it assumes
Distinguishes regular containers from completion-oriented init containers before applying the Always restart policy.
What you can do after
Operate/configure native sidecars in pod manifests and verify initialization and Running states with kubectl.
How it connects
Connects init containers with multicontainer pods, Services, and pod initialization order.

Also explained in

Compare how 2 books explain native sidecar →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.