CmdID

CmdID / Commands

kubectl-proxy

Create a proxy server or application-level gateway between localhost and the Kubernetes API server. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Run a proxy using the default settings on port 8001 and listen on localhost

kubectl proxyIdentify

Proxy part of the Kubernetes API while serving static files from a local directory

kubectl proxy --www path/to/static_dir --www-prefix /static_prefix/ --api-prefix /api_subset/Identify
--wwwAlso serve static files from the given directory under the specified prefix. kubectl reference
--www-prefixPrefix to serve static files under, if static file directory is specified. kubectl reference
--api-prefixPrefix to serve the proxied API under. kubectl reference

Proxy the entire Kubernetes API under a custom prefix

kubectl proxy --api-prefix /custom_prefix/Identify
--api-prefixPrefix to serve the proxied API under. kubectl reference

Serve the Kubernetes API on a specific port while also serving static content

kubectl proxy --port port --www path/to/static_dirIdentify
--portThe port on which to run the proxy. kubectl reference
--wwwAlso serve static files from the given directory under the specified prefix. kubectl reference

Run a proxy on a random local port, printing the chosen port to stdout

kubectl proxy --port 0Identify
--portThe port on which to run the proxy. kubectl reference

Run the proxy on a Unix domain socket instead of a TCP port

kubectl proxy --unix-socket path/to/socketIdentify
--unix-socketUnix socket on which to run the proxy. kubectl reference

Accept connections from remote hosts by listening on all interfaces (use caution when exposing the proxy publicly)

kubectl proxy --address 0.0.0.0 --accept-hosts '.*'Identify
--addressThe IP address on which to serve on. kubectl reference
--accept-hostsRegular expression for hosts that the proxy should accept. kubectl reference

Allow only selected API paths while rejecting sensitive endpoints

kubectl proxy --accept-paths '^/api/v1/namespaces/default/.*' --reject-paths '^/api/.*/pods/.*/exec'Identify
--accept-pathsRegular expression for paths that the proxy should accept. kubectl reference
--reject-pathsRegular expression for paths that the proxy should reject. kubectl reference