I think kke_lab_devops-k8s-update-deployment failed incorrectly


So the task was:

There is an application deployed on Kubernetes cluster. Recently Nautilus application development team developed a new version of the application that needs to be deployed now. As per new updates some new changes need to be made in this existing setup. So update the deployment and service as per details mentioned below:
We already have a deployment named nginx-deployment and service named nginx-service. Some changes need to be made in this deployment and service, make sure not to delete the deployment and service.
1.) Change the service nodeport from 30008 to 30005
2.) Change replicas count from 1 to 5
3.) Add command a command: [“sh”,"-c",“while true; do apt update; apt install -y vim php ; sleep 3; done”]
4.) Change the image from nginx:1.18 to nginx:latest
Note: The kubectl utility on jump_host has been configured to work with the kubernetes cluster.

I updated the NodePort port and that looked okay

kubectl edit svc nginx-service
port: 30005
kubectl describe svc nginx-service

I updated the deployment details and that looked okay.

kubectl edit deployment nginx-deployment
image: nginx:latest
replicas: 5
command: ["sh"]
args: ["-c","while true; do apt update; apt install -y vim php ; sleep 3; done"]
kubectl describe deployment nginx-deployment

But when I finished the task it said:

Task Status - Failed - Command  "sh","-c","while true; do apt update; apt install -y vim php ; sleep 3; done" not added under nginx-deployment

From my understanding of using commands and arguments according to the CKAD course by KK and https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#define-a-command-and-arguments-when-you-create-a-pod and https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#run-a-command-in-a-shell that was the correct way to do it.

If I was incorrect please explain what I was meant to do.

Hello, blindcant
Inderpreet clarified in this post Kubernetes shared volumes task

Thanks for the reply, looks like I did it the best practice way and not the Kode Kloud Engineer way :rofl:

1 Like

I think in the tasks they said to use command and not with args. Might be the reason.

Yeah I see that, but the CKAD KK course says to use args and so does the k8s documentation. :thinking:

@Inderpreet can you please review this. I am also waiting for other tasks to be made pending again or marked as success.

@blindcant this issue is already fixed, share your KKE username so that we can mark this task Success for you.

I have shared it with you again via direct message. I am waiting for another as well to be fixed Setup Puppet Certs Autosign

@blindcant I will check that too. Can you please let me know if you have your today’s task already assigned ?

@Inderpreet yes I have a task assigned for today, which is “Deploy Apache Web Server on Kubernetes CLuster”


Task is “Update an Existing Deployment in Kubernetes”

Can you please check this task ? it seems everything looks fine.



@Inderpreet @rahul456

Can you please help on this task?

@q69145, sorry for the issue, this is marked pending for you, please give it an another try.

Thanks Rahul, it worked.