Skip to main content
bolbam@yahoo.com

4 days ago

kubernetes

Is there any kubectl command to generate the defination of kubernetes objects say pod?

Image of
4 days ago
There is not a specific caommand that will provide the definition yaml for a pod, but you can get some insight into a pod using kubectl describe more information can be found here.

Image of
4 days ago
You can use -o yaml and --export to get it as yaml and strip out clusters-specific state information:
kubectl get pod <pod name> -o yaml --export
Image of bolbam@yahoo.com
bolbam@yahoo.com
7 hours ago
Thanks for the quick response. Can we not generate the syntax of api-object(say pod) which will help me to fix validation error?