Hello and welcome to this lecture in the previous lecture.
we discussed the basics of ETCD. In this
lecture we will talk about ETCD’s role in kubernetes. The ETCD datastore stores information regarding the
cluster such as the nodes, pods, configs, secrets, accounts, roles, bindings and others.
Every information you see when you run the kubectl get command is from the ETCD server. Every change
you make to your cluster, such as adding additional nodes, deploying pods or replica sets are updated
in the ETCD server. Only once it is updated in the ETCD server, is the change considered to be complete.
Depending on how you setup your cluster, ETCD is deployed differently. Throughout this section we discuss
about two types of kubernetes deployment. One deployed from scratch and other using kubeadm tool.
The practice test environments are deployed using the kubeadm tool and later in this course when
we set up a cluster we set it up from scratch so it's good to know the difference between the two methods
if you set up your cluster from scratch then you deploy ETCD by downloading the ETCD binaries yourself,
installing the binaries and configuring ETCD as a service in your master node yourself. There are many
options passed into the service a number of them relate to certificates we will learn more about these
certificates how to create them and how to configure them later in this course we have a whole section
on TLS certificates. The others are about configuring ETCD as a cluster. We will look at those options
when we set up high availability in kubernetes the only option to note for now is the advertised client
url.
This is the address on which ETCD listens. It happens to be on the IP of the server and on port
2379, which is the default port on which etcd listens.
This is the URL that should be configured on the kube-api server when it tries to reach the etcd server.
If you setup your cluster using kubeadm then kubeadm deploys the ETCD server for you as a POD in
the kube-system namespace. You can explore the etcd database using the etcdctl utility within this
pod. To list all keys stored by kubernetes, run the etcdctl get command like this. Kubernetes stores
data in the specific directory structure the root directory is a registry and under that you have the
various kubernetes constructs such as minions or nodes, pods, replicasets, deployments etc. In a
high availability environment you will have multiple master nodes in your cluster then you will have
multiple ETCD instances spread across the master nodes.
In that case, make sure to specify the ETCD instances know about each other by setting the right parameter
in the ETCD service configuration. The initial-cluster option is where you must specify the different
instances of the ETCD service.
We talk about high availability in much more detail later in this course but I thought its worth while
to point it out here.
Well, that's it for this lecture and I will see you in the next.