<p>Is there any way to run <code>kubectl proxy</code>, giving it a command as input, and shutting it down when the response is received?</p>

<p>I'm imagining something with the <code>-u</code> (unix socket) flag, like this:</p>

<pre><code>kubectl proxy -u - &lt; $(echo "GET /api/v1/namespaces/default")
</code></pre>

<p>I don't think it's possible, but maybe my socket fu just isn't strong enough.</p>

philo
<p>You don't need a long-running <code>kubectl proxy</code> for this.</p>

<p>Try this:</p>

<pre><code>kubectl get --raw=/api/v1/namespaces/default
</code></pre>
