You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh-cn/docs/concepts/architecture/control-plane-node-communication.md
+95-48Lines changed: 95 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
-
title: 控制面到节点通信
2
+
title: 节点与控制面之间的通信
3
3
content_type: concept
4
4
weight: 20
5
5
---
6
6
7
7
<!--
8
-
title: Control Plane-Node Communication
8
+
title: Communication between Nodes and the Control Plane
9
9
content_type: concept
10
10
weight: 20
11
11
aliases:
@@ -15,79 +15,105 @@ aliases:
15
15
<!-- overview -->
16
16
17
17
<!--
18
-
This document catalogs the communication paths between the control plane (apiserver) and the Kubernetes cluster. The intent is to allow users to customize their installation to harden the network configuration such that the cluster can be run on an untrusted network (or on fully public IPs on a cloud provider).
18
+
This document catalogs the communication paths between the API server and the Kubernetes cluster.
19
+
The intent is to allow users to customize their installation to harden the network configuration
20
+
such that the cluster can be run on an untrusted network (or on fully public IPs on a cloud
21
+
provider).
19
22
-->
20
23
本文列举控制面节点(确切说是 API 服务器)和 Kubernetes 集群之间的通信路径。
21
-
目的是为了让用户能够自定义他们的安装,以实现对网络配置的加固,使得集群能够在不可信的网络上
22
-
(或者在一个云服务商完全公开的 IP 上)运行。
24
+
目的是为了让用户能够自定义他们的安装,以实现对网络配置的加固,
25
+
使得集群能够在不可信的网络上(或者在一个云服务商完全公开的 IP 上)运行。
23
26
24
27
<!-- body -->
28
+
25
29
<!--
26
30
## Node to Control Plane
27
-
Kubernetes has a "hub-and-spoke" API pattern. All API usage from nodes (or the pods they run) terminates at the apiserver. None of the other control plane components are designed to expose remote services. The apiserver is configured to listen for remote connections on a secure HTTPS port (typically 443) with one or more forms of client [authentication](/docs/reference/access-authn-authz/authentication/) enabled.
28
-
One or more forms of [authorization](/docs/reference/access-authn-authz/authorization/) should be enabled, especially if [anonymous requests](/docs/reference/access-authn-authz/authentication/#anonymous-requests) or [service account tokens](/docs/reference/access-authn-authz/authentication/#service-account-tokens) are allowed.
31
+
32
+
Kubernetes has a "hub-and-spoke" API pattern. All API usage from nodes (or the pods they run)
33
+
terminates at the API server. None of the other control plane components are designed to expose
34
+
remote services. The API server is configured to listen for remote connections on a secure HTTPS
35
+
port (typically 443) with one or more forms of client
Nodes should be provisioned with the public root certificate for the cluster such that they can connect securely to the apiserver along with valid client credentials. A good approach is that the client credentials provided to the kubelet are in the form of a client certificate. See [kubelet TLS bootstrapping](/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/) for automated provisioning of kubelet client certificates.
54
+
Nodes should be provisioned with the public root certificate for the cluster such that they can
55
+
connect securely to the API server along with valid client credentials. A good approach is that the
56
+
client credentials provided to the kubelet are in the form of a client certificate. See
Pods that wish to connect to the apiserver can do so securely by leveraging a service account so that Kubernetes will automatically inject the public root certificate and a valid bearer token into the pod when it is instantiated.
51
-
The `kubernetes` service (in `default` namespace) is configured with a virtual IP address that is redirected (via kube-proxy) to the HTTPS endpoint on the apiserver.
66
+
Pods that wish to connect to the API server can do so securely by leveraging a service account so
67
+
that Kubernetes will automatically inject the public root certificate and a valid bearer token
68
+
into the pod when it is instantiated.
69
+
The `kubernetes` service (in `default` namespace) is configured with a virtual IP address that is
70
+
redirected (via `kube-proxy`) to the HTTPS endpoint on the API server.
52
71
53
72
The control plane components also communicate with the cluster apiserver over the secure port.
54
73
-->
55
74
想要连接到 API 服务器的 Pod 可以使用服务账号安全地进行连接。
56
75
当 Pod 被实例化时,Kubernetes 自动把公共根证书和一个有效的持有者令牌注入到 Pod 里。
57
-
`kubernetes` 服务(位于 `default` 名字空间中)配置了一个虚拟 IP 地址,用于(通过 kube-proxy)转发
58
-
请求到 API 服务器的 HTTPS 末端。
76
+
`kubernetes` 服务(位于 `default` 名字空间中)配置了一个虚拟 IP 地址,
77
+
用于(通过 kube-proxy)转发请求到 API 服务器的 HTTPS 末端。
59
78
60
79
控制面组件也通过安全端口与集群的 API 服务器通信。
61
80
62
81
<!--
63
-
As a result, the default operating mode for connections from the nodes and pods running on the nodes to the control plane is secured by default and can run over untrusted and/or public networks.
82
+
As a result, the default operating mode for connections from the nodes and pods running on the
83
+
nodes to the control plane is secured by default and can run over untrusted and/or public
84
+
networks.
64
85
-->
65
86
这样,从集群节点和节点上运行的 Pod 到控制面的连接的缺省操作模式即是安全的,
66
87
能够在不可信的网络或公网上运行。
67
88
68
89
<!--
69
90
## Control Plane to node
70
91
71
-
There are two primary communication paths from the control plane (apiserver) to the nodes. The first is from the apiserver to the kubelet process which runs on each node in the cluster. The second is from the apiserver to any node, pod, or service through the apiserver's proxy functionality.
92
+
There are two primary communication paths from the control plane (the API server) to the nodes.
93
+
The first is from the API server to the kubelet process which runs on each node in the cluster.
94
+
The second is from the API server to any node, pod, or service through the API server's _proxy_
95
+
functionality.
72
96
-->
73
-
## 控制面到节点
97
+
## 控制面到节点 {#control-plane-to-node}
74
98
75
99
从控制面(API 服务器)到节点有两种主要的通信路径。
76
100
第一种是从 API 服务器到集群中每个节点上运行的 kubelet 进程。
77
101
第二种是从 API 服务器通过它的代理功能连接到任何节点、Pod 或者服务。
78
102
79
103
<!--
80
-
### apiserver to kubelet
104
+
### API server to kubelet
81
105
82
-
The connections from the apiserver to the kubelet are used for:
106
+
The connections from the API server to the kubelet are used for:
83
107
84
108
* Fetching logs for pods.
85
-
* Attaching (through kubectl) to running pods.
109
+
* Attaching (usually through `kubectl`) to running pods.
86
110
* Providing the kubelet's port-forwarding functionality.
87
111
88
-
These connections terminate at the kubelet's HTTPS endpoint. By default, the apiserver does not verify the kubelet's serving certificate, which makes the connection subject to man-in-the-middle attacks and **unsafe** to run over untrusted and/or public networks.
112
+
These connections terminate at the kubelet's HTTPS endpoint. By default, the API server does not
113
+
verify the kubelet's serving certificate, which makes the connection subject to man-in-the-middle
114
+
attacks and **unsafe** to run over untrusted and/or public networks.
89
115
-->
90
-
### API 服务器到 kubelet
116
+
### API 服务器到 kubelet {#api-server-to-kubelet}
91
117
92
118
从 API 服务器到 kubelet 的连接用于:
93
119
@@ -100,15 +126,18 @@ These connections terminate at the kubelet's HTTPS endpoint. By default, the api
100
126
在非受信网络或公开网络上运行也是 **不安全的**。
101
127
102
128
<!--
103
-
To verify this connection, use the `--kubelet-certificate-authority` flag to provide the apiserver with a root certificate bundle to use to verify the kubelet's serving certificate.
129
+
To verify this connection, use the `--kubelet-certificate-authority` flag to provide the API
130
+
server with a root certificate bundle to use to verify the kubelet's serving certificate.
104
131
105
-
If that is not possible, use [SSH tunneling](#ssh-tunnels) between the apiserver and kubelet if required to avoid connecting over an
132
+
If that is not possible, use [SSH tunneling](#ssh-tunnels) between the API server and kubelet if
133
+
required to avoid connecting over an
106
134
untrusted or public network.
107
135
108
-
Finally, [Kubelet authentication and/or authorization](/docs/reference/access-authn-authz/kubelet-authn-authz/) should be enabled to secure the kubelet API.
The connections from the apiserver to a node, pod, or service default to plain HTTP connections and are therefore neither authenticated nor encrypted. They can be run over a secure HTTPS connection by prefixing `https:` to the node, pod, or service name in the API URL, but they will not validate the certificate provided by the HTTPS endpoint nor provide client credentials. So while the connection will be encrypted, it will not provide any guarantees of integrity. These connections **are not currently safe** to run over untrusted or public networks.
150
+
### API server to nodes, pods, and services
151
+
152
+
The connections from the API server to a node, pod, or service default to plain HTTP connections
153
+
and are therefore neither authenticated nor encrypted. They can be run over a secure HTTPS
154
+
connection by prefixing `https:` to the node, pod, or service name in the API URL, but they will
155
+
not validate the certificate provided by the HTTPS endpoint nor provide client credentials. So
156
+
while the connection will be encrypted, it will not provide any guarantees of integrity. These
157
+
connections **are not currently safe** to run over untrusted or public networks.
124
158
-->
125
-
### API 服务器到节点、Pod 和服务
159
+
### API 服务器到节点、Pod 和服务 {#api-server-to-nodes-pods-and-services}
126
160
127
161
从 API 服务器到节点、Pod 或服务的连接默认为纯 HTTP 方式,因此既没有认证,也没有加密。
128
162
这些连接可通过给 API URL 中的节点、Pod 或服务名称添加前缀 `https:` 来运行在安全的 HTTPS 连接上。
@@ -133,38 +167,51 @@ The connections from the apiserver to a node, pod, or service default to plain H
133
167
<!--
134
168
### SSH tunnels
135
169
136
-
Kubernetes supports SSH tunnels to protect the control plane to nodes communication paths. In this configuration, the apiserver initiates an SSH tunnel to each node in the cluster (connecting to the ssh server listening on port 22) and passes all traffic destined for a kubelet, node, pod, or service through the tunnel.
137
-
This tunnel ensures that the traffic is not exposed outside of the network in which the nodes are running.
138
-
139
-
SSH tunnels are currently deprecated, so you shouldn't opt to use them unless you know what you are doing. The Konnectivity service is a replacement for this communication channel.
170
+
Kubernetes supports SSH tunnels to protect the control plane to nodes communication paths. In this
171
+
configuration, the API server initiates an SSH tunnel to each node in the cluster (connecting to
172
+
the SSH server listening on port 22) and passes all traffic destined for a kubelet, node, pod, or
173
+
service through the tunnel.
174
+
This tunnel ensures that the traffic is not exposed outside of the network in which the nodes are
175
+
running.
140
176
-->
141
177
### SSH 隧道 {#ssh-tunnels}
142
178
143
-
Kubernetes 支持使用 SSH 隧道来保护从控制面到节点的通信路径。在这种配置下,API
144
-
服务器建立一个到集群中各节点的 SSH 隧道(连接到在 22 端口监听的 SSH 服务)
179
+
Kubernetes 支持使用 SSH 隧道来保护从控制面到节点的通信路径。在这种配置下,
180
+
API 服务器建立一个到集群中各节点的 SSH 隧道(连接到在 22 端口监听的 SSH 服务器)
145
181
并通过这个隧道传输所有到 kubelet、节点、Pod 或服务的请求。
146
182
这一隧道保证通信不会被暴露到集群节点所运行的网络之外。
147
183
184
+
{{< note >}}
185
+
<!--
186
+
SSH tunnels are currently deprecated, so you shouldn't opt to use them unless you know what you are doing. The Konnectivity service is a replacement for this communication channel.
As a replacement to the SSH tunnels, the Konnectivity service provides TCP level proxy for the control plane to cluster communication. The Konnectivity service consists of two parts: the Konnectivity server in the control plane network and the Konnectivity agents in the nodes network. The Konnectivity agents initiate connections to the Konnectivity server and maintain the network connections.
157
-
After enabling the Konnectivity service, all control plane to nodes traffic goes through these connections.
158
-
159
-
Follow the [Konnectivity service task](/docs/tasks/extend-kubernetes/setup-konnectivity/) to set up the Konnectivity service in your cluster.
0 commit comments