Skip to content

Commit 4fc01b4

Browse files
authored
Merge pull request #47888 from neolit123/1.32-add-linux-windows-task-pages
kubeadm: add task pages for adding Linux and Windows worker nodes
2 parents 67c575a + 65107c7 commit 4fc01b4

File tree

4 files changed

+290
-82
lines changed

4 files changed

+290
-82
lines changed

content/en/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm.md

Lines changed: 17 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ The control-plane node is the machine where the control plane components run, in
166166
communicates with).
167167

168168
1. (Recommended) If you have plans to upgrade this single control-plane `kubeadm` cluster
169-
to high availability you should specify the `--control-plane-endpoint` to set the shared endpoint
170-
for all control-plane nodes. Such an endpoint can be either a DNS name or an IP address of a load-balancer.
169+
to [high availability](/docs/setup/production-environment/tools/kubeadm/high-availability/)
170+
you should specify the `--control-plane-endpoint` to set the shared endpoint for all control-plane nodes.
171+
Such an endpoint can be either a DNS name or an IP address of a load-balancer.
171172
1. Choose a Pod network add-on, and verify whether it requires any arguments to
172173
be passed to `kubeadm init`. Depending on which
173174
third-party provider you choose, you might need to set the `--pod-network-cidr` to
@@ -343,6 +344,11 @@ control-plane node or a node that has the kubeconfig credentials:
343344
kubectl apply -f <add-on.yaml>
344345
```
345346

347+
{{< note >}}
348+
Only a few CNI plugins support Windows. More details and setup instructions can be found
349+
in [Adding Windows worker nodes](/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/#network-config).
350+
{{< /note >}}
351+
346352
You can install only one Pod network per cluster.
347353

348354
Once a Pod network has been installed, you can confirm that it is working by
@@ -391,90 +397,20 @@ from the control plane node, which excludes it from the list of backend servers:
391397
kubectl label nodes --all node.kubernetes.io/exclude-from-external-load-balancers-
392398
```
393399

394-
### Joining your nodes {#join-nodes}
395-
396-
The nodes are where your workloads (containers and Pods, etc) run. To add new nodes to your cluster do the following for each machine:
397-
398-
* SSH to the machine
399-
* Become root (e.g. `sudo su -`)
400-
* [Install a runtime](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-runtime)
401-
if needed
402-
* Run the command that was output by `kubeadm init`. For example:
403-
404-
```bash
405-
kubeadm join --token <token> <control-plane-host>:<control-plane-port> --discovery-token-ca-cert-hash sha256:<hash>
406-
```
407-
408-
If you do not have the token, you can get it by running the following command on the control-plane node:
409-
410-
```bash
411-
kubeadm token list
412-
```
413-
414-
The output is similar to this:
415-
416-
```console
417-
TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS
418-
8ewj1p.9r9hcjoqgajrj4gi 23h 2018-06-12T02:51:28Z authentication, The default bootstrap system:
419-
signing token generated by bootstrappers:
420-
'kubeadm init'. kubeadm:
421-
default-node-token
422-
```
423-
424-
By default, tokens expire after 24 hours. If you are joining a node to the cluster after the current token has expired,
425-
you can create a new token by running the following command on the control-plane node:
426-
427-
```bash
428-
kubeadm token create
429-
```
430-
431-
The output is similar to this:
400+
### Adding more control plane nodes
432401

433-
```console
434-
5didvk.d09sbcov8ph2amjw
435-
```
436-
437-
If you don't have the value of `--discovery-token-ca-cert-hash`, you can get it by running the
438-
following command chain on the control-plane node:
439-
440-
```bash
441-
openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | \
442-
openssl dgst -sha256 -hex | sed 's/^.* //'
443-
```
444-
445-
The output is similar to:
446-
447-
```console
448-
8cb2de97839780a412b93877f8507ad6c94f73add17d5d7058e91741c9d5ec78
449-
```
450-
451-
{{< note >}}
452-
To specify an IPv6 tuple for `<control-plane-host>:<control-plane-port>`, IPv6 address must be enclosed in square brackets, for example: `[2001:db8::101]:2073`.
453-
{{< /note >}}
402+
See [Creating Highly Available Clusters with kubeadm](/docs/setup/production-environment/tools/kubeadm/high-availability/) for steps on creating a high availability kubeadm cluster by adding more control plane
403+
nodes.
454404

455-
The output should look something like:
405+
### Adding worker nodes {#join-nodes}
456406

457-
```
458-
[preflight] Running pre-flight checks
407+
The worker nodes are where your workloads run.
459408

460-
... (log output of join workflow) ...
409+
The following pages show how to add Linux and Windows worker nodes to the cluster by using
410+
the `kubeadm join` command:
461411

462-
Node join complete:
463-
* Certificate signing request sent to control-plane and response
464-
received.
465-
* Kubelet informed of new secure connection details.
466-
467-
Run 'kubectl get nodes' on control-plane to see this machine join.
468-
```
469-
470-
A few seconds later, you should notice this node in the output from `kubectl get
471-
nodes` when run on the control-plane node.
472-
473-
{{< note >}}
474-
As the cluster nodes are usually initialized sequentially, the CoreDNS Pods are likely to all run
475-
on the first control-plane node. To provide higher availability, please rebalance the CoreDNS Pods
476-
with `kubectl -n kube-system rollout restart deployment coredns` after at least one new node is joined.
477-
{{< /note >}}
412+
* [Adding Linux worker nodes](/docs/tasks/administer-cluster/kubeadm/adding-linux-nodes/)
413+
* [Adding Windows worker nodes](/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/)
478414

479415
### (Optional) Controlling your cluster from machines other than the control-plane node
480416

content/en/docs/setup/production-environment/tools/kubeadm/install-kubeadm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ see the [Creating a cluster with kubeadm](/docs/setup/production-environment/too
2222
* A compatible Linux host. The Kubernetes project provides generic instructions for Linux distributions
2323
based on Debian and Red Hat, and those distributions without a package manager.
2424
* 2 GB or more of RAM per machine (any less will leave little room for your apps).
25-
* 2 CPUs or more.
25+
* 2 CPUs or more for control plane machines.
2626
* Full network connectivity between all machines in the cluster (public or private network is fine).
2727
* Unique hostname, MAC address, and product_uuid for every node. See [here](#verify-mac-address) for more details.
2828
* Certain ports are open on your machines. See [here](#check-required-ports) for more details.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: Adding Linux worker nodes
3+
content_type: task
4+
weight: 50
5+
---
6+
7+
<!-- overview -->
8+
9+
This page explains how to add Linux worker nodes to a kubeadm cluster.
10+
11+
## {{% heading "prerequisites" %}}
12+
13+
* Each joining worker node has installed the required components from
14+
[Installing kubeadm](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/), such as,
15+
kubeadm, the kubelet and a {{< glossary_tooltip term_id="container-runtime" text="container runtime" >}}.
16+
* A running kubeadm cluster created by `kubeadm init` and following the steps
17+
in the document [Creating a cluster with kubeadm](/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/).
18+
* You need superuser access to the node.
19+
20+
<!-- steps -->
21+
22+
## Adding Linux worker nodes
23+
24+
To add new Linux worker nodes to your cluster do the following for each machine:
25+
26+
1. Connect to the machine by using SSH or another method.
27+
1. Run the command that was output by `kubeadm init`. For example:
28+
29+
```bash
30+
sudo kubeadm join --token <token> <control-plane-host>:<control-plane-port> --discovery-token-ca-cert-hash sha256:<hash>
31+
```
32+
33+
### Additional information for kubeadm join
34+
35+
{{< note >}}
36+
To specify an IPv6 tuple for `<control-plane-host>:<control-plane-port>`, IPv6 address must be enclosed in square brackets, for example: `[2001:db8::101]:2073`.
37+
{{< /note >}}
38+
39+
If you do not have the token, you can get it by running the following command on the control plane node:
40+
41+
```bash
42+
sudo kubeadm token list
43+
```
44+
45+
The output is similar to this:
46+
47+
```console
48+
TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS
49+
8ewj1p.9r9hcjoqgajrj4gi 23h 2018-06-12T02:51:28Z authentication, The default bootstrap system:
50+
signing token generated by bootstrappers:
51+
'kubeadm init'. kubeadm:
52+
default-node-token
53+
```
54+
55+
By default, node join tokens expire after 24 hours. If you are joining a node to the cluster after the
56+
current token has expired, you can create a new token by running the following command on the
57+
control plane node:
58+
59+
```bash
60+
sudo kubeadm token create
61+
```
62+
63+
The output is similar to this:
64+
65+
```console
66+
5didvk.d09sbcov8ph2amjw
67+
```
68+
69+
If you don't have the value of `--discovery-token-ca-cert-hash`, you can get it by running the
70+
following commands on the control plane node:
71+
72+
```bash
73+
sudo cat /etc/kubernetes/pki/ca.crt | openssl x509 -pubkey | openssl rsa -pubin -outform der 2>/dev/null | \
74+
openssl dgst -sha256 -hex | sed 's/^.* //'
75+
```
76+
77+
The output is similar to:
78+
79+
```console
80+
8cb2de97839780a412b93877f8507ad6c94f73add17d5d7058e91741c9d5ec78
81+
```
82+
83+
The output of the `kubeadm join` command should look something like:
84+
85+
```
86+
[preflight] Running pre-flight checks
87+
88+
... (log output of join workflow) ...
89+
90+
Node join complete:
91+
* Certificate signing request sent to control-plane and response
92+
received.
93+
* Kubelet informed of new secure connection details.
94+
95+
Run 'kubectl get nodes' on control-plane to see this machine join.
96+
```
97+
98+
A few seconds later, you should notice this node in the output from `kubectl get nodes`.
99+
(for example, run `kubectl` on a control plane node).
100+
101+
{{< note >}}
102+
As the cluster nodes are usually initialized sequentially, the CoreDNS Pods are likely to all run
103+
on the first control plane node. To provide higher availability, please rebalance the CoreDNS Pods
104+
with `kubectl -n kube-system rollout restart deployment coredns` after at least one new node is joined.
105+
{{< /note >}}
106+
107+
## {{% heading "whatsnext" %}}
108+
109+
* See how to [add Windows worker nodes](/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/).

0 commit comments

Comments
 (0)