<p>currently busy learning kubernetes and running configs on the command line, and I'm using an M1 MacOS running on version 11.5.1, and one of the commands I wanted to run is <code>curl &quot;http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy&quot;</code> but I get the below error message <code>curl: (3) URL using bad/illegal format or missing URL</code>. Not sure if anyone has experienced this issue before, would appreciate the help.</p>

msingathi majola
<p>First, <code>curl</code> command should receive only 1 host, not multiple hosts.
Therefore pod should be single.</p>
<p>Then, you need to save POD's name to a variable without any special characters.</p>
<p>Last, when you're using <code>kubectl proxy</code>, you need to add <code>-L</code> option to the <code>curl</code> command so it will follow the redirection.</p>
<p>Simple example will be:</p>
<pre><code># run pod with echo image
kubectl run echo --image=mendhak/http-https-echo

# start proxy
kubectl proxy

# export pod's name
export POD_NAME=echo

# curl with `-I` - headers and `-L` - follow redirects
curl -IL http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy
HTTP/1.1 301 Moved Permanently
Location: /api/v1/namespaces/default/pods/echo/proxy/

HTTP/1.1 200 OK
</code></pre>
