<p>What api endpoint can I call to get a pod or service's yaml?</p>
<p>The kubectl command to get a pod's yaml is</p>
<blockquote>
<p>kubectl get pod my-pod -o yaml</p>
</blockquote>
<p>but what endpoint does kubectl use to get it?</p>

Cinnabams
<blockquote>
<p>kubectl get pod my-pod -o yaml</p>
</blockquote>
<blockquote>
<p>but what endpoint does kubectl use to get it?</p>
</blockquote>
<p>If you add <code>-v 7</code> or <code>-v 6</code> to the command, you get verbose logs that show you all the <strong>API requests</strong></p>
<p>Example:</p>
<pre><code>kubectl get pods -v 6
I0816 22:59:03.047132   11794 loader.go:372] Config loaded from file:  /Users/jonas/.kube/config
I0816 22:59:03.060115   11794 round_trippers.go:454] GET https://127.0.0.1:52900/api/v1/namespaces/default/pods?limit=500 200 OK in 9 milliseconds

</code></pre>
<p>So you see that it does this API request:</p>
<pre><code>/api/v1/namespaces/default/pods?limit=500
</code></pre>
<p>The API only returns the response in Json and the client can transform to Yaml when using <code>-o yaml</code>.</p>
