I am trying to deploy my app to Kubernetes running in Google Container Engine.
The app can be found at: https://github.com/Industrial/docker-znc.>
Is only minor difference from @Janos Lenart's answer!
kubectl get deploy deploymentname -o yaml > outputFile.yaml will do
kubectl get deploy deploymentname -o yaml > outputFile.yaml