Kubernetes 101 : Sidecar containers - Sharing storage with a sidecar container -

Instead of modifying the image of a container, we could add logging or database functionalities to it for example by running a sidecar container alongside the main container within the same pod.

In order to share data between the main container and a sidecar container we could use shared volumes:

Below is a Yaml file that has a "main" container - debian -  and a sidecar container -nginx- :

To be able to reach our sidecar container, we could use the below command:


Leave as a comment: