Install load balancer (metallb) and Gateway API
MetalLB is a load balancer implementation for Kubernetes that allows services to be exposed externally
Gateway API is a newer way to manage traffic to Kubernetes cluster.
For on prem-clusters, install load balancer using metallb
Add metallb helm chart, download and install metallb
helm repo add metallb https://metallb.github.io/metallb
wget https://raw.githubusercontent.com/metallb/metallb/main/charts/metallb/values.yaml
helm install metallb metallb/metallb --values values.yaml
Verify metallb is deployed
kubectl -n default get pods
Prepare the metallb Ip files(metallb_ip.yaml), and modify the IP address (with range provided by your network team)
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: default
spec:
addresses:
- 172.16.20.16-172.16.20.23 <- Change this to your range of IP
autoAssign: true
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: default
spec:
ipAddressPools:
- default
Apply IP address pool range
kubectl apply -f metallb_ip.yaml
Verify metallb ip address pool
kubectl get IPAddressPool
kubectl describe IPAddressPool
- Setup Gateway APIs
For non-secure connections (dev clusters), install steps 1 to 4
For secure connections, install additional steps 5 to 10