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.txtfile - 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