Sidecar kubernetes containers

@mmumshad @Tej-Singh-Rana @kodekloud-support3
Strange message error!!! please see below. Worked as expected,but marked failed!!!


1 Like

sorry for inconvenience this is marked success for you

1 Like

@rahul456
Thank you for your support

Can you please check mine also?

Hello, @Surendar
Where is your task? Where we look?

Yesterday I did this task “Kubernetes Sidecar Containers” correctly, but it says error as “Container ‘nginx-container’ not found under webserver Pod”.
Can you please check on that.

Can you share your yaml file? or any image so I can look into. Validation checks only done by KKE team. Else you have to wait for the response.

Sure Please find the yaml file.

@Surendar
Both containers should be defined under single “Containers” block,
Because you have used two Containers block , it is failing i think

Hi @Surendar

You have used the containers block multiple times. In a single resource it shouldn’t be used more then once. Otherwise it will only run one block and thus all the containers will not be initiated.

If only you would have checked below you would have seen that with your resource it would be one container running instead of two something like below :

$ kubectl get pods
NAME        READY   STATUS    RESTARTS   AGE
webserver   **1/1**   Running   0      4m20s

@Surendar, you have not deployed sidecar-container as sidecar container, you should have deployed it like

spec:
  containers:
   - name: c1
     image: debian
          
   - name: c2
     image: nginx