|
| 1 | +--- |
| 2 | +title: 端口和协议 |
| 3 | +content_type: reference |
| 4 | +weight: 50 |
| 5 | +--- |
| 6 | +<!-- |
| 7 | +--- |
| 8 | +title: Ports and Protocols |
| 9 | +content_type: reference |
| 10 | +weight: 50 |
| 11 | +--- |
| 12 | +--> |
| 13 | + |
| 14 | +<!-- |
| 15 | +When running Kubernetes in an environment with strict network boundaries, such |
| 16 | +as on-premises datacenter with physical network firewalls or Virtual |
| 17 | +Networks in Public Cloud, it is useful to be aware of the ports and protocols |
| 18 | +used by Kubernetes components |
| 19 | +--> |
| 20 | +当你在一个有严格网络边界的环境里运行 Kubernetes,例如拥有物理网络防火墙或者拥有公有云中虚拟网络的自有数据中心,了解 Kubernetes 组件使用了哪些端口和协议是非常有用的。 |
| 21 | + |
| 22 | +<!-- |
| 23 | +## Control plane |
| 24 | +
|
| 25 | +| Protocol | Direction | Port Range | Purpose | Used By | |
| 26 | +|----------|-----------|------------|-------------------------|---------------------------| |
| 27 | +| TCP | Inbound | 6443 | Kubernetes API server | All | |
| 28 | +| TCP | Inbound | 2379-2380 | etcd server client API | kube-apiserver, etcd | |
| 29 | +| TCP | Inbound | 10250 | Kubelet API | Self, Control plane | |
| 30 | +| TCP | Inbound | 10259 | kube-scheduler | Self | |
| 31 | +| TCP | Inbound | 10257 | kube-controller-manager | Self | |
| 32 | +
|
| 33 | +Although etcd ports are included in control plane section, you can also host your own |
| 34 | +etcd cluster externally or on custom ports. |
| 35 | +--> |
| 36 | +## 控制面 {#control-plane} |
| 37 | + |
| 38 | +| 协议 | 方向 | 端口范围 | 目的 | 使用者 | |
| 39 | +|----------|-----------|------------|-------------------------|---------------------------| |
| 40 | +| TCP | 入站 | 6443 | Kubernetes API server | 所有 | |
| 41 | +| TCP | 入站 | 2379-2380 | etcd server client API | kube-apiserver, etcd | |
| 42 | +| TCP | 入站 | 10250 | Kubelet API | 自身, 控制面 | |
| 43 | +| TCP | 入站 | 10259 | kube-scheduler | 自身 | |
| 44 | +| TCP | 入站 | 10257 | kube-controller-manager | 自身 | |
| 45 | + |
| 46 | +尽管 etcd 的端口也列举在控制面的部分,但你也可以在外部自己托管 etcd 集群或者自定义端口。 |
| 47 | + |
| 48 | +<!-- |
| 49 | +## Worker node(s) {#node} |
| 50 | +
|
| 51 | +| Protocol | Direction | Port Range | Purpose | Used By | |
| 52 | +|----------|-----------|-------------|-----------------------|-------------------------| |
| 53 | +| TCP | Inbound | 10250 | Kubelet API | Self, Control plane | |
| 54 | +| TCP | Inbound | 30000-32767 | NodePort Services† | All | |
| 55 | +
|
| 56 | +† Default port range for [NodePort Services](/docs/concepts/services-networking/service/). |
| 57 | +
|
| 58 | +All default port numbers can be overridden. When custom ports are used those |
| 59 | +ports need to be open instead of defaults mentioned here. |
| 60 | +
|
| 61 | +One common example is API server port that is sometimes switched |
| 62 | +to 443. Alternatively, the default port is kept as is and API server is put |
| 63 | +behind a load balancer that listens on 443 and routes the requests to API server |
| 64 | +on the default port. |
| 65 | +--> |
| 66 | +## 工作节点 {#node} |
| 67 | + |
| 68 | +| 协议 | 方向 | 端口范围 | 目的 | 使用者 | |
| 69 | +|----------|-----------|-------------|-----------------------|-------------------------| |
| 70 | +| TCP | 入站 | 10250 | Kubelet API | 自身, 控制面 | |
| 71 | +| TCP | 入站 | 30000-32767 | NodePort Services† | 所有 | |
| 72 | + |
| 73 | +† [NodePort Services](/zh/docs/concepts/services-networking/service/)的默认端口范围。 |
| 74 | + |
| 75 | +所有默认端口都可以重新配置。当使用自定义的端口时,你需要打开这些端口来代替这里提到的默认端口。 |
| 76 | + |
| 77 | +一个常见的例子是 API 服务器的端口有时会配置为443。或者你也可以使用默认端口,把 API 服务器放到一个监听443 端口的负载均衡器后面,并且路由所有请求到 API 服务器的默认端口。 |
0 commit comments