# ETCD At this point we already know that we can run pods even withour API server. But current aproach is not very confortable to use, to create pod we need to place some manifest in some place. It is not very comfortable to manage. Now we will start our jorney of configuring "real" (more real than current, because current doesn't look like kubernetes at all) kubernetes. And of course we need to start with the storage. ![image](./img/04_cluster_architecture_etcd.png "Kubelet") For kubernetes (at least for original one if I can say so) we need to configura 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 single node database with authentication (by useage of client cert file). So, lets start. As I already said, communication with our etcd cluster will be secured, it means that we need to generate some keys, to encrypt all the trafic. To do so, we need to download tools which may help us to generate certificates ```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 ```bash { mv cfssl_1.4.1_linux_amd64 cfssl mv cfssljson_1.4.1_linux_amd64 cfssljson chmod +x cfssl cfssljson sudo mv cfssl cfssljson /usr/local/bin/ } ``` After the tools 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 <