kubectl proxy

We need certificates while accessing kube-apiserver as shown below.

curl $KUBE_SERVER/ \
    --key /path/client.key \
    --cert /path/client.crt \
    --cacert /path/ca.crt

To avoid providing these certificates every time we access server, kubectl allows us to create a proxy which uses these certificates information from kubeconfig.

kubectl proxy

This starts the server at port 8001. We can then access server through this proxy.

curl http://127.0.0.1:8001/