Configure kubeadm and Install Kubernetes on First Master

Generate a kubeadm-config.yaml on the first node with the Load Balancer and Endpoint information.

To use flannel, configure the pod-cidr as follows:


apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
kubernetesVersion: 1.13.1
apiServer:
  certSANs:
  - "haproxy0.lab.nirmata.io"
controlPlaneEndpoint: "haproxy0.lab.nirmata.io:6443"
networking:
  podSubnet: 10.244.0.0/16

Then run the Configure command.

Configure Command:

kubeadm init --config=kubeadm-config.yaml --node-name=<FQDN>

Next, setup a kubectl using the Setup command.

Setup Command:

mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config