The motiviation for this gist was the deprecation of the --export flag. Having the yaml definition of a running deployment has the advantage that it can be saved and edited. For example when updating the version of an image.
For this example we will just use a deployment of the Kubernetes Deployment documentation. This can be deployed using the command
kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml
To get the yaml definition the get
command can be used: