sidecar container
A helper container that runs beside the main container in the same pod, such as a proxy, a log shipper or a file refresher.
In more detail
Because it shares the pod's network and volumes it can intercept traffic or read files, but it also shares the pod's lifecycle and scaling. Current Kubernetes declares native sidecars as init containers with restartPolicy Always, so they start first and keep running. Do not hide an independent service in a sidecar; if it scales differently, give it its own pods.
Example
log-shipper violates restricted: needs runAsUser not 0, add only NET_BIND_SERVICERelated terms
- Pod — The smallest unit Kubernetes runs: one or more containers scheduled together on the same machine.
- container — A running program that has been fenced off from the rest of the computer so it only sees its own files, network and processes.
- securityContext — The part of a Kubernetes pod or container spec that sets security options such as user, capabilities, seccomp and read-only root filesystem.
- init container — A container in a pod that must run to completion before the main containers start, used for one-off setup such as waiting for a dependency.
- service mesh — A layer of proxies alongside every service that handles traffic between services: routing, retries, TLS and telemetry.
Taught in
- Security Frameworks: NIST CSF 2.0, ISO 27001 & CIS — Cybersecurity Fundamentals, GRC & Cryptography
- Troubleshooting: describe, Events And A First Smoke Test — Kubernetes: Production-Grade Container Orchestration
- Pods, Init Containers And Sidecars — Kubernetes: Production-Grade Container Orchestration
- NetworkPolicy And The Consul Service Mesh Boundary — Kubernetes: Production-Grade Container Orchestration
- Volumes, PersistentVolumes And PersistentVolumeClaims — Kubernetes: Production-Grade Container Orchestration