Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

Kubernetes Networking: Service - LoadBalancer

Back


LoadBalancer

# 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
  1. Service Creation
    • cmd: kubectl apply -f nginx-loadbalancer.yaml
    • API server store Service into etcd
    • cloud-controller-manager call AWS API to create AWS ELB with
      • public IP address
      • DNS name
    • automatically create a NodePort on each node
    • automatically create a ClusterIP for nginx


Install MetalLB

kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.15.3/config/manifests/metallb-frr.yaml