Follow this documentation to set up a highly available Kubernetes cluster using Red Hat Enterprise Linux 8.3(Ootpa)
This documentation guides you in setting up a cluster with three master nodes, three worker nodes and a load balancer node using HAProxy.
Role | FQDN | IP | OS | RAM | CPU |
---|---|---|---|---|---|
Load Balancer | rhellb1 | 192.168.1.8 | RHEL 8.3 | 8G | 2 |
Master | rhelmaster1 | 192.168.1.2 | RHEL 8.3 | 8G | 2 |
Master | rhelmaster2 | 192.168.1.3 | RHEL 8.3 | 8G | 2 |
Master | rhelmaster3 | 192.168.1.4 | RHEL 8.3 | 8G | 2 |
Worker | rhelworker1 | 192.168.1.5 | RHEL 8.3 | 8G | 2 |
Worker | rhelworker1 | 192.168.1.6 | RHEL 8.3 | 8G | 2 |
Worker | rhelworker1 | 192.168.1.7 | RHEL 8.3 | 8G | 2 |
Use bootstrap scripts to set up iptables:
- Open port 2222 on OpenSSH
- Open port 6443 on Kube-apiserver
- Open port 2379-2380 on etcd server client API
- Open 10250 on Kubelet API
- Open 10251 on Kube-scheduler
- Open 10252 on Kube-controller-Manager
- Open port 2222 on OpenSSH
- Open port 10250 on Kubelet API
- Open port 30000-32767 on NodePort Services
yum update && yum install -y haproxy
Append the below lines to /etc/haproxy/haproxy.cfg
frontend kubernetes-frontend
bind 192.168.1.8:6443
mode tcp
option tcplog
default_backend kubernetes-backend
backend kubernetes-backend
mode tcp
option tcp-check
balance roundrobin
server rhelmaster1 192.168.1.2:6443 check fall 3 rise 2
server rhelmaster2 192.168.1.3:6443 check fall 3 rise 2
server rhelmaster3 192.168.1.4:6443 check fall 3 rise 2
systemctl restart haproxy
git clone https://github.com/grzegorzgniadek/RedHatK8SCluster-Ansible
cd RedHat-HA-KubernetesCluster
ansible-playbook -Kk site.yaml
kubectl cluster-info
kubectl get nodes
kubectl get cs