kube-vip provides Kubernetes clusters with a virtual IP and load balancer for both the control plane (for building a highly-available cluster) and Kubernetes Services of type LoadBalancer without relying on any external hardware or software.
Documentation - https://kube-vip.io/docs/
curl -sfL https://raw.githubusercontent.com/kube-vip/kube-vip-cloud-provider/main/manifest/kube-vip-cloud-controller.yaml > /var/lib/rancher/rke2/server/manifests/kube-vip-cloud-controller.yaml
cat<<EOF > kube-vip-config.yaml
—-
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-vip
namespace: kube-system
data:
range-global: 192.168.3.220-192.168.3.230
EOF
cp kube-vip-config.yaml > /var/lib/rancher/rke2/server/manifests
kubectl create deploy nginx --image=nginx:stable-alpine
kubectl expose deploy nginx --port=80 -type-LoadBalancer
kubectl get service
curl http://<IP_Address>