kubectl-proxy
Create a proxy server or application-level gateway between localhost and the Kubernetes API server. tldr-pages
On several platforms
Several platforms
Run a proxy using the default settings on port 8001 and listen on localhost
kubectl proxyIdentifyProxy 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 referenceProxy the entire Kubernetes API under a custom prefix
kubectl proxy --api-prefix /custom_prefix/Identify--api-prefixPrefix to serve the proxied API under. kubectl referenceServe 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 referenceRun 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 referenceRun 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 referenceAccept 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 referenceAllow 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