Skip to content

Commit

Permalink
Create 03-ETCD-in-Kubernetes.md
Browse files Browse the repository at this point in the history
  • Loading branch information
K2-KK authored Jun 17, 2020
1 parent d4fde36 commit f291a72
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/02-Core-Concepts/03-ETCD-in-Kubernetes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ETCD in Kubernetes
- Take me to [Video Tutorial](https://kodekloud.com/courses/539883/lectures/9808160)

In this section, we will take a look at ETCD role in kubernetes

## ETCD Datastore
- The ETCD Datastore stores information regarding the cluster such as **`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`**.

## Setup - Manual
- If you setup your cluster from scratch then you deploy **`ETCD`** by downloading ETCD Binaries yourself
- Installing Binaries and Configuring ETCD as a service in your master node yourself.

![etcd](../../images/etcd.PNG)

## Setup - Kubeadm
- If you setup your cluster using **`kubeadm`** then kubeadm will deploy etcd server for you as a pod in **`kube-system`** namespace.
```
$ kubectl get pods -n kube-system
```
![etcd1](../../images/etcd1.PNG)

## Explore ETCD
- To list all keys stored by kubernetes, run the below command
```
$ kubectl exec etcd-master -n kube-system etcdctl get / --prefix -key
```
- Kubernetes Stores data in a specific directory structure, the root directory is the **`registry`** and under that you have varies kubernetes constructs such as **`minions`**, **`nodes`**, **`pods`**, **`replicasets`**, **`deployments`**, **`roles`**, **`secrets`** and **`Others`**.

![etcdctl1](../../images/etcdctl1.PNG)

## ETCD in HA Environment
- In a high availability environment, you will have multiple master nodes in your cluster that will have multiple ETCD Instances spread across the master nodes.
- Make sure etcd instances know each other by setting the right parameter in the **`etcd.service`** configuration. The **`--initial-cluster`** option where you need to specify the different instances of the etcd service.
![etcd-ha](../../images/etcd-ha.PNG)

0 comments on commit f291a72

Please sign in to comment.