title: Restart only sidecar container in Kubernetes
body: <p>I have two containers in my POD. First container is my main application and second is used as sidecar container having following images having following Dockerfile.</p>
  
  <pre><code>FROM scratch
  
  EXPOSE 8080
  ADD my-binary /
  
  ENV GOROOT=/usr/lib/go
  ENTRYPOINT ["/my-binary"]
  </code></pre>
  
  <p>Basically it's using <strong>scratch</strong> and my-binary is a go application which running as process. So I cannot <strong>exec</strong> on this side car container. I have a requirement to re-start the side container(my-binary), but there should be no change in the main container. Main container should not be altered in any way.</p>
  
  <p>Is there any possibility, how I can achieve this?</p>
  
  <p>Thank you so much for looking into this.</p>
  
  <p>Someone has asked to provide the complete details of POD, then you can consider following pod structure</p>
  
  <pre><code>apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: my-deployment
    labels:
      app: my-deploy
  spec:
    template:
      metadata:
        labels:
          app: my-app
      spec:
        containers:
        - name: main
          image: my-main-app-image
          ports:
          - containerPort: 80
        - name: my-go-binary
          image: my-go-binary-image
  </code></pre>
  
  <p>Please note- </p>
  
  <pre><code>kubectl exec POD_NAME -c CONTAINER_NAME reboot 
  </code></pre>
  
  <p>this is not going to work for 2nd container as it is scratch image.</p>