Get YAML for deployed Kubernetes services?

Industrial picture Industrial · May 12, 2017 · Viewed 77.6k times · Source

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.

The Dockerfile is built into an image on Google Container Registry.

I have deployed the app in Kubernetes via the + button. I don't have the YAML for this.

I have inserted a Secret in Kubernetes for the PEM file required by the app.

  1. How do I get the YAML for the Deployment, Service and Pod created by Kubernetes by filling in the form?
  2. How do I get the Secret into my Pod for usage?

Answer

Janos Lenart picture Janos Lenart · May 12, 2017

To get the yaml for a deployment (service, pod, secret, etc):

kubectl get deploy deploymentname -o yaml --export