@@ -63,6 +63,28 @@ devicemapper storage. This should not be used for production.
6363
6464> NOTE: This step is done automatically if using vagrant.
6565
66+ ### For HA, setup the load balancer node
67+
68+ Ideally, the load balancer node will be a separate node. However, one of the
69+ master nodes can also serve as the load balancer for the cluster. [ HAProxy] ( https://www.haproxy.org/ )
70+ is used in these instructions.
71+
72+ ``` bash
73+ sudo swupd bundle-add haproxy
74+ sudo systemctl enable haproxy
75+ ```
76+
77+ Edit the master IP addresses and load balancer address and ports in [ ` haproxy.cfg.example ` ] ( haproxy.cfg.example )
78+ to match the IPs for the new cluster. If using a master node for the load balancer
79+ make sure that the ` frontend bind ` port is different than the Kubernetes API port, 6443.
80+ If using a separate machine for load balancing, the port can be 6443 if desired.
81+
82+ ``` bash
83+ sudo mkdir -p /etc/haproxy
84+ sudo cp haproxy.cfg.example /etc/haproxy/haproxy.cfg
85+ sudo systemctl start haproxy
86+ ```
87+
6688## Bring up the master
6789
6890Run [ ` create_stack.sh ` ] ( create_stack.sh ) on the master node. This sets up the
@@ -75,8 +97,9 @@ more information.
7597
7698> NOTE: Before running [ ` create_stack.sh ` ] ( create_stack.sh ) script, make sure to export
7799 the necessary environment variables if needed to be changed. By default it will use
78- ` CLRK8S_CNI ` to be canal, and ` CLRK8S_RUNNER ` to be crio. Cilium is tested only in the
79- Vagrant.
100+ ` CLRK8S_CNI ` to be canal, and ` CLRK8S_RUNNER ` to be crio. Cilium is tested only in the
101+ Vagrant. If creating an HA cluster, make sure to specify ` LOAD_BALANCER_IP ` and
102+ ` LOAD_BALANCER_PORT ` .
80103
81104``` bash
82105# default shows help
@@ -86,6 +109,13 @@ Vagrant.
86109In order to enable running greater than 110 pods per node, set the environment
87110variable ` HIGH_POD_COUNT ` to any non-empty value.
88111
112+ If creating an HA cluster, join the other master nodes to the cluster.
113+
114+ ``` bash
115+ kubeadm join < load-balancer-ip> :< load-balancer-port> --token < token> --discovery-token-ca-cert-hash < hash> \
116+ --control-plane --certificate-key < certificate-key> --cri-socket=/run/crio/crio.sock
117+ ```
118+
89119## Join Workers to the cluster
90120
91121``` bash
@@ -94,6 +124,9 @@ kubeadm join <master-ip>:<master-port> --token <token> --discovery-token-ca-cert
94124
95125Note: Remember to append ` --cri-socket=/run/crio/crio.sock ` to the join command generated by the master.
96126
127+ If creating an HA cluster, join the other worker nodes to the cluster. The same way,
128+ but replacing the ` <master-ip>:<master-port> ` with ` <load-balancer-ip>:<load-balancer-port> ` .
129+
97130On workers just use the join command that the master spits out. There nothing
98131else you need to run on the worker. All the other Kubernetes customizations are pushed
99132in from master via the values setup in the ` kubeadm.yaml ` file.
0 commit comments