79410012

Date: 2025-02-03 21:02:27
Score: 1
Natty:
Report link

I was looking for this answer myself and as far as I can tell: You can't

The question is not about how do you get the yaml of an existing pod, but of a pod that fails to create due to a mutating webhook. Based on my search, I can't find a way to directly get the yaml after the webhook modifies the spec but before it runs into the pod errors.

In these cases your best bet is to look at the logs of the pod that is performing the webhook, or the kube-apiserver if you have proper permissions. In my case I was able to find a log of the patches that were being performed that matched my error message.

When a webhook is not involved, then the other answers are correct, you can simply kubectl get -o yaml on the pod, deployment, or statefulset ect to check whats wrong.

Reasons:
  • Blacklisted phrase (1): how do you
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: topplesprout