Skip to content

Commit 764487f

Browse files
committed
add some extra info about etcd cluster health check and join
1 parent bf6c784 commit 764487f

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

content/en/blog/_posts/2023-09-25-kubeadm-use-etcd-learner-mode.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ The [`kubeadm`](/docs/reference/setup-tools/kubeadm/) tool now supports etcd lea
1111
allows you to enhance the resilience and stability
1212
of your Kubernetes clusters by leveraging the [learner mode](https://etcd.io/docs/v3.4/learning/design-learner/#appendix-learner-implementation-in-v34)
1313
feature introduced in etcd version 3.4.
14-
This guide will walk you through using etcd learner mode with kubeadm.
14+
This guide will walk you through using etcd learner mode with kubeadm. By default, kubeadm runs
15+
a local etcd instance on each control plane node.
1516

1617
In v1.27, kubeadm introduced a new feature gate `EtcdLearnerMode`. With this feature gate enabled,
17-
when joining a new control plane node, a new etcd member will be created as a learner and
18+
when joining a new control plane node, a new etcd member will be created as a learner and
1819
promoted to a voting member only after the etcd data are fully aligned.
1920

2021
## What are the advantages of using etcd learner mode?
@@ -69,11 +70,31 @@ The kubeadm tool deploys a single-node Kubernetes cluster with etcd set to use l
6970
Before joining a control-plane node to the new Kubernetes cluster, ensure that the existing control plane nodes
7071
and all etcd members are healthy.
7172
73+
Check the cluster health with `etcdctl`. If `etcdctl` isn't available, you can run this tool inside a container image.
74+
You would do that directly with your container runtime using a tool such as `crictl run` and not through Kubernetes
75+
76+
Here is an example on a client command that uses secure communication to check the cluster health of the etcd cluster:
77+
78+
```shell
79+
ETCDCTL_API=3 etcdctl --endpoints 127.0.0.1:2379 \
80+
--cert=/etc/kubernetes/pki/etcd/server.crt \
81+
--key=/etc/kubernetes/pki/etcd/server.key \
82+
--cacert=/etc/kubernetes/pki/etcd/ca.crt \
83+
member list
84+
...
85+
dc543c4d307fadb9, started, node1, https://10.6.177.40:2380, https://10.6.177.40:2379, false
86+
```
87+
88+
To check if the Kubernetes control plane is healthy, run `kubectl get node -l node-role.kubernetes.io/control-plane=`
89+
and check if the nodes are ready.
90+
91+
Note: It is recommended to have an odd number of members in a etcd cluster.
92+
7293
Before joining a worker node to the new Kubernetes cluster, ensure that the control plane nodes are healthy.
7394

7495
## What's next
7596

76-
- The feature gate `EtcdLearnerMode` is alpha in v1.27 and will we expect it to graduate beta in the next
97+
- The feature gate `EtcdLearnerMode` is alpha in v1.27 and we expect it to graduate to beta in the next
7798
minor release of Kubernetes (v1.29).
7899
- etcd has an open issue that may make the process more automatic:
79100
[Support auto-promoting a learner member to a voting member](https://github.com/etcd-io/etcd/issues/15107).

0 commit comments

Comments
 (0)