kubectl-proxy

runs a proxy to the Kubernetes API server

TLDR

Start API proxy
$ kubectl proxy
Proxy on specific port
$ kubectl proxy --port=[8001]
Allow external access
$ kubectl proxy --address=[0.0.0.0] --accept-hosts='.*'
Proxy specific API paths
$ kubectl proxy --api-prefix=/api/

SYNOPSIS

kubectl proxy [options]

DESCRIPTION

kubectl proxy runs a proxy to the Kubernetes API server. Handles authentication and allows accessing the API and services without exposing them directly. Default port is 8001.

PARAMETERS

--port port

Port to run proxy on.
--address address
Address to bind to.
--accept-hosts regex
Hosts to accept requests from.
--api-prefix prefix
API prefix for proxy.

INSTALL

sudo apt install kubectl
sudo pacman -S kubectl
sudo apk add kubectl
brew install kubectl
nix profile install nixpkgs#kubectl

SEE ALSO

kubectl(1), kubectl-port-forward(1)