CKS Mock Exam 2 question 6 - how is the line validated?

Check the ReplicaSet events and write the event lines containing the reason why the Pod isn’t recreated into /opt/course/logs.txt.

Note: You may see multiple identical event lines with the same error. Paste only one of them in the logs.txt file - preferably the last one.

My events output

$ k get events -n team-red
[...]
13m         Warning   FailedCreate        replicaset/hacker-5cc9458666   Error creating: pods "hacker-5cc9458666-ftn4x" is forbidden: violates PodSecurity "baseline:latest": hostPath volumes (volume "containerd-volume")
13m         Warning   FailedCreate        replicaset/hacker-5cc9458666   Error creating: pods "hacker-5cc9458666-nb76v" is forbidden: violates PodSecurity "baseline:latest": hostPath volumes (volume "containerd-volume")
2m30s       Warning   FailedCreate        replicaset/hacker-5cc9458666   (combined from similar events): Error creating: pods "hacker-5cc9458666-p6nmm" is forbidden: violates PodSecurity "baseline:latest": hostPath volumes (volume "containerd-volume")
54m         Normal    ScalingReplicaSet   deployment/hacker              Scaled up replica set hacker-5cc9458666 from 0 to 1

I tried storing both 13m Warning FailedCreate replicaset/hacker-5cc9458666 Error creating: pods "hacker-5cc9458666-nb76v" is forbidden: violates PodSecurity "baseline:latest": hostPath volumes (volume "containerd-volume") and just Error creating: pods "hacker-5cc9458666-nb76v" is forbidden: violates PodSecurity "baseline:latest": hostPath volumes (volume "containerd-volume")

Neither is accepted

I also tried one from k describe rs -n team-red that looks like Warning FailedCreate 15m replicaset-controller Error creating: pods hacker-5cc9458666-thdqc is forbidden: violates PodSecurity baseline:latest: hostPath volumes (volume containerd-volume) and it’s also wrong

Not sure what the grader wants in that file. I’ll ask the log team for clarification.

I’m told the grader was only accepting output from “k describe”. The lab engineer has extended that so it now accepts “k event” output as well. Much thanks for the report!