All technological notes.
LoadBalancer
load balancer (e.g., AWS ELB, GCP LB, Azure LB) and links it to the Service.
public IP or DNS name.ClusterIP + NodePort under the hood.How it works
with AWS cloud
# nginx-loadbalancer.yaml
apiVersion: v1
kind: Service
metadata:
name: nginx-loadbalancer
spec:
type: LoadBalancer
selector:
app: nginx
ports:
- protocol: TCP
port: 80 # Service port (LB port)
targetPort: 80 # Pod port
kubectl apply -f nginx-loadbalancer.yamlAPI server store Service into etcdcloud-controller-manager call AWS API to create AWS ELB with
NodePort on each nodeClusterIP for nginxAWS ELB (3.120.45.67:80) → NodeIP:31234 → ClusterIP (10.96.0.20:80) → Pod IP (10.244.x.x:80)NodePort 31234 is forwarded to Service ClusterIP 10.96.0.20.ClusterIP is mapped to the Endpoints list (your Nginx Pods).kube-proxy load balances traffic across Pods (whether local or on other Nodes).LoadBalancer service type is an extension of the NodePort type,
load balancer stands in front of the nodes and handles the connections coming from the clients.service by forwarding it to the node port on one of the nodes.the client never attempts to connect to an unavailable node because the load balancer forwards traffic only to healthy nodes.
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.15.3/config/manifests/metallb-frr.yaml