← 返回命令列表

Linux command

kubectl-proxy 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

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/

说明

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.

参数

--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.

FAQ

What is the kubectl-proxy command used for?

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.

How do I run a basic kubectl-proxy example?

Run `kubectl proxy` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --port _port_ do in kubectl-proxy?

Port to run proxy on.