kubectl proxy - Run a proxy to the Kubernetes API server
kubectl proxy [--port=PORT] [--address=ADDR]
Options you will use
-p, --port=8001- The port on which to run the proxy. Set to 0 to pick a random port.
--address=127.0.0.1- The IP address on which to serve on.
Examples
$ kubectl proxy &Starting to serve on 127.0.0.1:8001
$ curl localhost:8001/api/v1/namespaces/shop/podsthe raw API, authenticated with your kubeconfig
$ curl localhost:8001/api/v1/namespaces/shop/services/web:80/proxy/the apiserver's service proxy: reach a ClusterIP service from outside
Gotchas
- kubectl proxy authenticates for you: anything that can reach 127.0.0.1:8001 has your permissions.
Try kubectl proxy in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.