# ETCD At this point, we already know that we can run pods even without an API server. To create a pod we need to place some manifest in some place. It is not very comfortable to manage. Now we will start configuring "real" (more real than current, because current doesn't look like kubernetes at all) kubernetes cluster. ![image](./img/04_cluster_architecture_etcd.png "Kubelet") For kubernetes (at least for the original one if I can say so) we need to configure a database called [etcd](https://etcd.io/). >etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster of machines. It gracefully handles leader elections during network partitions and can tolerate machine failure, even in the leader node. Our etcd will be configured as a single node database with authentication. So, let's start. ## certificates We will configure etcd to authenticate users by the certificate file used during communication. To do so, we need to generate some certs. We will create certificate files using cfssl and cfssljson tools (that should be installed before we start) First of all, we will download the tools mentioned ```bash wget -q --show-progress --https-only --timestamping \ https://github.com/cloudflare/cfssl/releases/download/v1.4.1/cfssl_1.4.1_linux_amd64 \ https://github.com/cloudflare/cfssl/releases/download/v1.4.1/cfssljson_1.4.1_linux_amd64 ``` And install them ```bash mv cfssl_1.4.1_linux_amd64 cfssl \ && mv cfssljson_1.4.1_linux_amd64 cfssljson \ && chmod +x cfssl cfssljson \ && mv cfssl cfssljson /usr/local/bin/ ``` After the tools are installed successfully, we need to generate ca certificate. A ca (Certificate Authority) certificate, also known as a root certificate or a trusted root certificate, is a digital certificate that is used to verify the authenticity of other certificates. ```bash { cat > ca-config.json < ca-csr.json < to simplify our kubernetes deployment, we will use this certificate for other kubernetes components as well, that is why we will add some extra configs (like KUBERNETES_HOST_NAME to it) ```bash { HOST_NAME=$(hostname -a) KUBERNETES_HOSTNAMES=kubernetes,kubernetes.default,kubernetes.default.svc,kubernetes.default.svc.cluster,kubernetes.svc.cluster.local cat > kubernetes-csr.json <