用run命令生成

kubectl run —image=nginx my-deploy -o yaml —dry-run >my-deploy.yaml

用get命令生成

kubectl get pod nginx-w-997f65bb9-5sxcz -o=yaml —export >my-nginx.yaml

pod容器的字段忘记拼写了

kubectl explain —help
kubectl explain pods.spec.containers