If you wish to routinely generate a manifest file in Kubernetes, you are able to do so through the use of the kubectl run
command coupled with a --dry-run
to output on to yaml
.
kubectl run nginx --image=nginx --port=80 --replicas=2 --expose --dry-run -o yaml
You too can output this on to a file on disk as follows:
kubectl run nginx --image=nginx --port=80 --replicas=2 --expose --dry-run -o yaml > your-deployment-manifest.yaml