Skip to content

Commit 5ea6ba0

Browse files
authored
Merge pull request #46758 from sftim/20240610_improve_etcd_intro
Improve etcd task introduction
2 parents 2a5b858 + 3b7d420 commit 5ea6ba0

File tree

1 file changed

+46
-33
lines changed

1 file changed

+46
-33
lines changed

content/en/docs/tasks/administer-cluster/configure-upgrade-etcd.md

Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,62 +14,68 @@ weight: 270
1414

1515
## {{% heading "prerequisites" %}}
1616

17-
You need to have a Kubernetes cluster, and the kubectl command-line tool must
18-
be configured to communicate with your cluster. It is recommended to follow this
19-
guide on a cluster with at least two nodes that are not acting as control plane
20-
nodes. If you do not already have a cluster, you can create one by using
21-
[minikube](https://minikube.sigs.k8s.io/docs/tutorials/multi_node/).
17+
Before you follow steps in this page to deploy, manage, back up or restore etcd,
18+
you need to understand the typical expectations for operating an etcd cluster.
19+
Refer to the [etcd documentation](https://etcd.io/docs/) for more context.
2220

23-
### Understanding etcdctl and etcdutl
21+
Key details include:
2422

25-
`etcdctl` and `etcdutl` are command-line tools used to interact with etcd clusters, but they serve different purposes:
26-
27-
- `etcdctl`: This is the primary command-line client for interacting with etcd over a
28-
network. It is used for day-to-day operations such as managing keys and values,
29-
administering the cluster, checking health, and more.
30-
31-
- `etcdutl`: This is an administration utility designed to operate directly on etcd data
32-
files, including migrating data between etcd versions, defragmenting the database,
33-
restoring snapshots, and validating data consistency. For network operations, `etcdctl`
34-
should be used.
35-
36-
For more information on `etcdutl`, you can refer to the [etcd recovery documentation](https://etcd.io/docs/v3.5/op-guide/recovery/).
37-
38-
<!-- steps -->
39-
40-
## Prerequisites
41-
42-
* Run etcd as a cluster of odd members.
23+
* The minimum recommended etcd versions to run in production are `3.4.22+` and `3.5.6+`.
4324

4425
* etcd is a leader-based distributed system. Ensure that the leader
4526
periodically send heartbeats on time to all followers to keep the cluster
4627
stable.
4728

48-
* Ensure that no resource starvation occurs.
29+
* You should run etcd as a cluster with an odd number of members.
30+
31+
* Aim to ensure that no resource starvation occurs.
4932

5033
Performance and stability of the cluster is sensitive to network and disk
5134
I/O. Any resource starvation can lead to heartbeat timeout, causing instability
5235
of the cluster. An unstable etcd indicates that no leader is elected. Under
5336
such circumstances, a cluster cannot make any changes to its current state,
5437
which implies no new pods can be scheduled.
5538

56-
* Keeping etcd clusters stable is critical to the stability of Kubernetes
57-
clusters. Therefore, run etcd clusters on dedicated machines or isolated
58-
environments for [guaranteed resource requirements](https://etcd.io/docs/current/op-guide/hardware/).
59-
60-
* The minimum recommended etcd versions to run in production are `3.4.22+` and `3.5.6+`.
61-
62-
## Resource requirements
39+
### Resource requirements for etcd
6340

6441
Operating etcd with limited resources is suitable only for testing purposes.
6542
For deploying in production, advanced hardware configuration is required.
6643
Before deploying etcd in production, see
6744
[resource requirement reference](https://etcd.io/docs/current/op-guide/hardware/#example-hardware-configurations).
6845

46+
Keeping etcd clusters stable is critical to the stability of Kubernetes
47+
clusters. Therefore, run etcd clusters on dedicated machines or isolated
48+
environments for [guaranteed resource requirements](https://etcd.io/docs/current/op-guide/hardware/).
49+
50+
### Tools
51+
52+
Depending on which specific outcome you're working on, you will need the `etcdctl` tool or the
53+
`etcdutl` tool (you may need both).
54+
55+
<!-- steps -->
56+
57+
## Understanding etcdctl and etcdutl
58+
59+
`etcdctl` and `etcdutl` are command-line tools used to interact with etcd clusters, but they serve different purposes:
60+
61+
- `etcdctl`: This is the primary command-line client for interacting with etcd over a
62+
network. It is used for day-to-day operations such as managing keys and values,
63+
administering the cluster, checking health, and more.
64+
65+
- `etcdutl`: This is an administration utility designed to operate directly on etcd data
66+
files, including migrating data between etcd versions, defragmenting the database,
67+
restoring snapshots, and validating data consistency. For network operations, `etcdctl`
68+
should be used.
69+
70+
For more information on `etcdutl`, you can refer to the [etcd recovery documentation](https://etcd.io/docs/v3.5/op-guide/recovery/).
71+
72+
6973
## Starting etcd clusters
7074

7175
This section covers starting a single-node and multi-node etcd cluster.
7276

77+
This guide assumes that `etcd` is already installed.
78+
7379
### Single-node etcd cluster
7480

7581
Use a single-node etcd cluster only for testing purposes.
@@ -93,7 +99,14 @@ production and back it up periodically. A five-member cluster is recommended
9399
in production. For more information, see
94100
[FAQ documentation](https://etcd.io/docs/current/faq/#what-is-failure-tolerance).
95101

96-
Configure an etcd cluster either by static member information or by dynamic
102+
As you're using Kubernetes, you have the option to run etcd as a container inside
103+
one or more Pods. The `kubeadm` tool sets up etcd
104+
{{< glossary_tooltip text="static pods" term_id="static-pod" >}} by default, or
105+
you can deploy a
106+
[separate cluster](/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm/)
107+
and instruct kubeadm to use that etcd cluster as the control plane's backing store.
108+
109+
You configure an etcd cluster either by static member information or by dynamic
97110
discovery. For more information on clustering, see
98111
[etcd clustering documentation](https://etcd.io/docs/current/op-guide/clustering/).
99112

0 commit comments

Comments
 (0)