CKS Challenege 2 - startupProbe to remove shells

@Ayman I did it too

root@controlplane ~ :heavy_multiplication_x: k exec -it dev-webapp -n dev sh
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] – [COMMAND] instead.
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: “sh”: executable file not found in $PATH: unknown
command terminated with exit code 126

1 Like

Kindly check the attached gif
exec

I don’t get a green klick althought i have prevent the exec to run with a startup probe:
kubectl exec --stdin --tty -n staging staging-webapp – ash
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: “ash”: executable file not found in $PATH: unknown
command terminated with exit code 126

2 Likes

Of course, it works before modifying the pod. After disabling the shells, you can not access.

Same here, I don’t know what they are checking.

1 Like

Hi @fonguetaghuo ,
Can you please share the screenshot? and DM me your manifest file.

Regards,

Hi @Javier3 ,
Can you please DM me your manifest file? So you are having an issue only with this question?

Regards,

Hello, @Tej-Singh-Rana I can’t send it, I don’t know how. I can’t find the message button in your avatar.

EDIT: I’ve already sent it

Thanks for your help

Hi @Javier3 ; is the issue is solved; iam also facing the same issue

I have removed all command in /bin of the pod. No exec commands work on it after that but still the check fails :sweat_smile: :joy:

Now I able to solve 4 of the problems. 2 remain. Trying to create network policy fails. I have labelled the ns and created netpol based on namespace selector.

No, I can’t… I’ve sent the yaml to the admins, but I never got his answer

If the question requires only ingress to be allowed from prod namespace and egress is allowed from pods to outside prod namespace then the wordings of the question is wrong. Scratch… scratch :sweat_smile: :joy: :sob:

:joy:

Seems the wordings for the question cause some confusion.


:sweat_smile: :joy: :rofl: :star_struck: :star_struck:

Is there a bounty :innocent: :wink:

Clicking on the sa arrow should throw some details. Seems this part of the diagram is not working properly, assumed from the arrow what is expected and voila got a congratulations … :nerd_face:


Challenge 3 also solved…

HI @srinivasons; can you help in solving startupProbe to remove shells

@Anudeep-Nalla :nerd_face: it is simple. Just follow the document and read the yaml syntax example properly and replicate. Read question for dev and staging one of the questions is more descriptive.

Challenge 4 solved :star_struck: :sweat_smile: :joy: :rofl:

@srinivasons thanks, it is solved.

1 Like

That’s what I did with the StartupProbes challenge and the lab verified successfully.
I made the edits to the dev and staging pod definition files.

1 Like