Skip to content

Commit 348eb87

Browse files
authored
Merge pull request #33132 from tengqm/format-controlplane-comm
Reformat the control-plane-node-communication page
2 parents ce05dcf + 4267267 commit 348eb87

File tree

1 file changed

+75
-28
lines changed

1 file changed

+75
-28
lines changed

content/en/docs/concepts/architecture/control-plane-node-communication.md

Lines changed: 75 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
reviewers:
33
- dchen1107
44
- liggitt
5-
title: Control Plane-Node Communication
5+
title: Communication between Nodes and the Control Plane
66
content_type: concept
77
weight: 20
88
aliases:
@@ -11,62 +11,109 @@ aliases:
1111

1212
<!-- overview -->
1313

14-
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).
15-
16-
14+
This document catalogs the communication paths between the API server and the Kubernetes cluster.
15+
The intent is to allow users to customize their installation to harden the network configuration
16+
such that the cluster can be run on an untrusted network (or on fully public IPs on a cloud
17+
provider).
1718

1819
<!-- body -->
1920

2021
## Node to Control Plane
21-
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.
22-
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.
2322

24-
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.
23+
Kubernetes has a "hub-and-spoke" API pattern. All API usage from nodes (or the pods they run)
24+
terminates at the API server. None of the other control plane components are designed to expose
25+
remote services. The API server is configured to listen for remote connections on a secure HTTPS
26+
port (typically 443) with one or more forms of client
27+
[authentication](/docs/reference/access-authn-authz/authentication/) enabled.
28+
One or more forms of [authorization](/docs/reference/access-authn-authz/authorization/) should be
29+
enabled, especially if [anonymous requests](/docs/reference/access-authn-authz/authentication/#anonymous-requests)
30+
or [service account tokens](/docs/reference/access-authn-authz/authentication/#service-account-tokens)
31+
are allowed.
32+
33+
Nodes should be provisioned with the public root certificate for the cluster such that they can
34+
connect securely to the API server along with valid client credentials. A good approach is that the
35+
client credentials provided to the kubelet are in the form of a client certificate. See
36+
[kubelet TLS bootstrapping](/docs/reference/command-line-tools-reference/kubelet-tls-bootstrapping/)
37+
for automated provisioning of kubelet client certificates.
2538

26-
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.
27-
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.
39+
Pods that wish to connect to the API server can do so securely by leveraging a service account so
40+
that Kubernetes will automatically inject the public root certificate and a valid bearer token
41+
into the pod when it is instantiated.
42+
The `kubernetes` service (in `default` namespace) is configured with a virtual IP address that is
43+
redirected (via `kube-proxy`) to the HTTPS endpoint on the API server.
2844

29-
The control plane components also communicate with the cluster apiserver over the secure port.
45+
The control plane components also communicate with the API server over the secure port.
3046

31-
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.
47+
As a result, the default operating mode for connections from the nodes and pods running on the
48+
nodes to the control plane is secured by default and can run over untrusted and/or public
49+
networks.
3250

33-
## Control Plane to node
51+
## Control plane to node
3452

35-
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.
53+
There are two primary communication paths from the control plane (the API server) to the nodes.
54+
The first is from the API server to the kubelet process which runs on each node in the cluster.
55+
The second is from the API server to any node, pod, or service through the API server's _proxy_
56+
functionality.
3657

37-
### apiserver to kubelet
58+
### API server to kubelet
3859

39-
The connections from the apiserver to the kubelet are used for:
60+
The connections from the API server to the kubelet are used for:
4061

4162
* Fetching logs for pods.
42-
* Attaching (through kubectl) to running pods.
63+
* Attaching (usually through `kubectl`) to running pods.
4364
* Providing the kubelet's port-forwarding functionality.
4465

45-
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.
66+
These connections terminate at the kubelet's HTTPS endpoint. By default, the API server does not
67+
verify the kubelet's serving certificate, which makes the connection subject to man-in-the-middle
68+
attacks and **unsafe** to run over untrusted and/or public networks.
4669

47-
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.
70+
To verify this connection, use the `--kubelet-certificate-authority` flag to provide the API
71+
server with a root certificate bundle to use to verify the kubelet's serving certificate.
4872

49-
If that is not possible, use [SSH tunneling](#ssh-tunnels) between the apiserver and kubelet if required to avoid connecting over an
73+
If that is not possible, use [SSH tunneling](#ssh-tunnels) between the API server and kubelet if
74+
required to avoid connecting over an
5075
untrusted or public network.
5176

52-
Finally, [Kubelet authentication and/or authorization](/docs/reference/access-authn-authz/kubelet-authn-authz/) should be enabled to secure the kubelet API.
5377

54-
### apiserver to nodes, pods, and services
78+
Finally, [Kubelet authentication and/or authorization](/docs/reference/access-authn-authz/kubelet-authn-authz/)
79+
should be enabled to secure the kubelet API.
5580

56-
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.
81+
### API server to nodes, pods, and services
82+
83+
The connections from the API server to a node, pod, or service default to plain HTTP connections
84+
and are therefore neither authenticated nor encrypted. They can be run over a secure HTTPS
85+
connection by prefixing `https:` to the node, pod, or service name in the API URL, but they will
86+
not validate the certificate provided by the HTTPS endpoint nor provide client credentials. So
87+
while the connection will be encrypted, it will not provide any guarantees of integrity. These
88+
connections **are not currently safe** to run over untrusted or public networks.
5789

5890
### SSH tunnels
5991

60-
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.
61-
This tunnel ensures that the traffic is not exposed outside of the network in which the nodes are running.
92+
Kubernetes supports SSH tunnels to protect the control plane to nodes communication paths. In this
93+
configuration, the API server initiates an SSH tunnel to each node in the cluster (connecting to
94+
the SSH server listening on port 22) and passes all traffic destined for a kubelet, node, pod, or
95+
service through the tunnel.
96+
This tunnel ensures that the traffic is not exposed outside of the network in which the nodes are
97+
running.
6298

63-
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.
99+
{{< note >}}
100+
SSH tunnels are currently deprecated, so you shouldn't opt to use them unless you know what you
101+
are doing. The [Konnectivity service](#konnectivity-service) is a replacement for this
102+
communication channel.
103+
{{< /note >}}
64104

65105
### Konnectivity service
66106

67107
{{< feature-state for_k8s_version="v1.18" state="beta" >}}
68108

69-
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.
70-
After enabling the Konnectivity service, all control plane to nodes traffic goes through these connections.
109+
As a replacement to the SSH tunnels, the Konnectivity service provides TCP level proxy for the
110+
control plane to cluster communication. The Konnectivity service consists of two parts: the
111+
Konnectivity server in the control plane network and the Konnectivity agents in the nodes network.
112+
The Konnectivity agents initiate connections to the Konnectivity server and maintain the network
113+
connections.
114+
After enabling the Konnectivity service, all control plane to nodes traffic goes through these
115+
connections.
116+
117+
Follow the [Konnectivity service task](/docs/tasks/extend-kubernetes/setup-konnectivity/) to set
118+
up the Konnectivity service in your cluster.
71119

72-
Follow the [Konnectivity service task](/docs/tasks/extend-kubernetes/setup-konnectivity/) to set up the Konnectivity service in your cluster.

0 commit comments

Comments
 (0)