Creating multi master kubernetes HA cluster with config.yaml

5/10/2018

I am now exploring how to create the HA kubernetes cluster with 3 master and 3 worker nodes. I am following the following documentation,

https://kubernetes.io/docs/setup/independent/high-availability/

Here , I am following second option from documentation. Ie, Hosting etcd cluster on the master nodes. So according to documentation i am starting with step -" Run kubeadm init on master0". Means I am hosting etcd cluster on the master nodes.And when I am refering the configuration file that I need to create , I have confusion regarding some terms in configuration file. Let me add the configuration file here for clarity,

   cat >config.yaml <<EOF
   apiVersion: kubeadm.k8s.io/v1alpha1
   kind: MasterConfiguration
   api:
      advertiseAddress: <private-ip>
   etcd:
      endpoints:
      - https://<etcd0-ip-address>:2379
      - https://<etcd1-ip-address>:2379
      - https://<etcd2-ip-address>:2379
      caFile: /etc/kubernetes/pki/etcd/ca.pem
      certFile: /etc/kubernetes/pki/etcd/client.pem
      keyFile: /etc/kubernetes/pki/etcd/client-key.pem
   networking:
     podSubnet: <podCIDR>
   apiServerCertSANs:
   - <load-balancer-ip>
   apiServerExtraArgs:
     apiserver-count: "3"
   EOF 

Doubts

  1. here , and , Can I replace etcd0-ip-address , etcd1-ip-address and etcd2-ip-address with the IP address of the machines that I choose for master nodes ? , Since I am not forming etcd in separate VMs. I am chooses to create on the same master nodes. So can I directly give the 3 master VM's IP address here?
-- Jacob
kubernetes

1 Answer

5/10/2018

I want to extend Jonah Benton’s answer which briefly describes how it works.

A Kubernetes cluster consists of three main types of components. The installed components create a role for a node. The node is a virtual or physical machine where cluster services are running. The components can be logically located on separate nodes or installed on one node, as in minikube.

Kubernetes master nodes require running API server, Controller Manager, Scheduler and etc daemon. While using these software components, the master node is managing worker nodes where container engine, iptables, kubelet and service proxy are running.

Etcd is a component where the state of running cluster for HA, load balancing and health checks of the nodes are saved. It is recommended to run etcd on 1, 3 or max 5 nodes of the cluster to achieve reliability and replication of cluster condition. Worker node with etcd as additional component installed is a popular method of installation.

We can call a true master node only the node where API server is running.

Let's look into the config file you provided:

    etcd:   
      endpoints: 
      - https://<etcd0-ip-address>:2379 
      - https://<etcd1-ip-address>:2379 
      - https://<etcd2-ip-address>:2379

Regarding your question, the answer is yes. This is a place reserved to define endpoints to etcd daemon. If you plan to have a High Availability cluster with master nodes running etcd, you can replace those entries with the master nodes IP addresses.

I found well-described components of Kubernetes in this document. It may help understand the dependence of Kubernetes Cluster.

-- d0bry
Source: StackOverflow