NodeBalancer is a managed load balancer requested through a Kubernetes Service with type LoadBalancer. It distributes requests across cluster nodes and their Pods while providing a static public IP address. section 8.5.1
A NodeBalancer deployment connects several Kubernetes concerns:
- Kubernetes routes requests from the external load balancer through the Service to matching Pods. section 8.5.1
- The static public IP can receive a DNS A record for a custom domain. section 8.5.1
- Managed load balancing typically adds a separate service cost. section 8.5.1
Listing 8.27 Service for the Python app
apiVersion: v1
kind: Service
metadata:
name: py-book
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: http-port
selector:
app: py-deploy
See a minimal Service manifest that requests a NodeBalancer and forwards public port 80 to the application’s named HTTP port. section 8.5.1
