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.