<p>so we have two containers running in a pod.. the idea is to have main container doing the job( receiving request) and a secondary container doing a background task of constantly checking the main app network status</p>

<p>i have my deployment file with the secondary container coming up first and then the main container coming after, please check code snippet below <a href="https://gist.github.com/dapseen/51bc7e59b96d934938a4afce34c615bb" rel="nofollow noreferrer">https://gist.github.com/dapseen/51bc7e59b96d934938a4afce34c615bb</a> Is it because of the placement of container i.e fund worker coming starting up first that makes it the main app and other container coming up after makes it secondary container.</p>

<p>Is there a special annotation in k8 that can tell cluster or kubernetes the container to make side car?</p>

<p>Question rephrased...</p>

<p><strong>how can i specify that a container should be sidecar</strong></p>

<p><strong><em>UPDATE</em></strong></p>

<p>The question came as a result of things i saw in rancher, i am using rancher for Kubernetes management, please check image below
<a href="https://i.stack.imgur.com/bqgin.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bqgin.png" alt="enter image description here"></a></p>

<p>I think rancher takes the first container as the main app and the second to be sidecar.. i cant find documentation to support it .
rancher version: 2.2.3</p>

Adedapo Ajuwon
<p>Side car is just a design pattern that is upto you to implement. Kubernetes supports the side car pattern but does not implement it for you.  Hence there is no option to inform kubernetes to treat a container as the side car. </p>
