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: bootstrap/kubeadm/docs/external-etcd.md
+38-6Lines changed: 38 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Cluster API Bootstrap Provider Kubeadm supports using an external etcd cluster for your workload Kubernetes clusters.
4
4
5
-
###⚠️ Warnings ⚠️
5
+
## ⚠️ Warnings ⚠️
6
6
7
7
Before getting started you should be aware of the expectations that come with using an external etcd cluster.
8
8
@@ -11,14 +11,38 @@ Before getting started you should be aware of the expectations that come with us
11
11
* As an example, cross availability zone traffic can cost money on cloud providers. You don't have to deploy etcd
12
12
across availability zones, but if you do please be aware of the costs.
13
13
14
-
###Getting started
14
+
## Getting started
15
15
16
16
To use this, you will need to create an etcd cluster and generate an apiserver-etcd-client key/pair.
17
-
[`etcdadm`](https://github.com/kubernetes-sigs/etcdadm) is a good way to get started if you'd like to test this
18
-
behavior.
17
+
This behaviour can be tested using [`kubeadm`](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm/) and [`etcdadm`](https://github.com/kubernetes-sigs/etcdadm).
18
+
19
+
### Setting up etcd with kubeadm
19
20
20
-
Once you create an etcd cluster, you will want to base64 encode the `/etc/etcd/pki/apiserver-etcd-client.crt`,
21
-
`/etc/etcd/pki/apiserver-etcd-client.key`, and `/etc/etcd/pki/server.crt` files and put them in two secrets. The secrets
21
+
CA certificates are required to setup etcd cluster.
22
+
If you already have a CA then the CA's `key` and `crt` must be copied to `/etc/kubernetes/pki/etcd/ca.crt` and `/etc/kubernetes/pki/etcd/ca.key`.
23
+
24
+
If you do not already have a CA then run command `kubeadm init phase certs etcd-ca`. This creates two files
25
+
26
+
*`/etc/kubernetes/pki/etcd/ca.crt`
27
+
*`/etc/kubernetes/pki/etcd/ca.key`
28
+
29
+
These key/pair are used to sign etcd server, peer certificates and eventually apiserver-etcd client. More information on how to setup external etcd with kubeadm can be found [`here`](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm/#setting-up-the-cluster).
30
+
31
+
You would require files `/etc/kubernetes/pki/apiserver-etcd-client.key`, `/etc/kubernetes/pki/apiserver-etcd-client.crt` and `/etc/kubernetes/pki/etcd/server.crt` to setup etcd cluster. These are put in 2 secrets.
**Note:** Above command has key/pair base64 encoded by default.
44
+
45
+
**Note:** Alternatively you can base64 encode the files and put them in two secrets. The secrets
22
46
must be formatted as follows and the cert material must be base64 encoded:
23
47
24
48
```yaml
@@ -53,6 +77,14 @@ data:
53
77
...
54
78
```
55
79
80
+
### Setting up etcd with etcdadm (Alpha)
81
+
`etcdadm` creates the CA if one does not exist, uses it to sign it's server and peer certificates, and finally to sign the apiserver etcd client certificate.
82
+
CA's `key` and `crt` generated using `etcdadm` are stored in `/etc/etcd/pki/apiserver-etcd-client.crt`, `/etc/etcd/pki/apiserver-etcd-client.key` and `/etc/etcd/pki/server.crt` .
83
+
84
+
85
+
Just like kubeadm, it is required to create 2 [`secrets`](https://kubernetes.io/docs/concepts/configuration/secret/#creating-a-secret-using-kubectl-create-secret) using these server and etcd client key/pair.
86
+
87
+
## Configuring CABPK
56
88
After that the rest is standard Kubeadm. Config your ClusterConfiguration as follows:
0 commit comments