以deployment为例

kubectl create deployment --image httpd deploymentname --dry-run=client -o yaml > deployment.yaml