Kubernetes - High Availability
Learn how to create high availability Kubernetes cluster
Prerequisites
- Please checkout previous installation tutorial to make sure that nothing lost
Create Reliable Storage Layer
Kubernetes use etcd as backend storage to keep cluster information. If we want to have a high availability of Kubernetes cluster, we need to set up etcd cluster as our reliable distributed key-value storage. Once we setup the etcd cluster, it will help us to populate data to whole etcd cluster.
Stop Single Node etcd
service etcd stop
Create etcd Cluster by Running Etcd on Multiple Nodes
sudo /opt/bin/etcd --name <node name> -data-dir <path to etcd data dir> \
--initial-advertise-peer-urls http://<node ip>:4000 \
--listen-peer-urls http://<node ip>:4000 \
--listen-client-urls http://127.0.0.1:4001,http://<node ip>:4001 \
--advertise-client-urls http://<node ip>:4001 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster <node1 name>=http://<node1 ip>:4000,<node2 name>=http://<node2 ip>:4000,<node3 name>=http://<node3 ip>:4000 \
--initial-cluster-state new