liveBook · Manning

Loadbalancer service

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A Kubernetes LoadBalancer Service type exposes a Service externally through an integrated or provisioned load balancer.

A LoadBalancer Service exposes an application outside the Kubernetes cluster through a cloud-provisioned or bare-metal load balancer. Its YAML resembles a ClusterIP Service; setting type to LoadBalancer is the key change, and a node port is not required for access. section 6.4.3

Create and verify a LoadBalancer Service with these administrator tasks:

  • Generate a manifest with kubectl create svc loadbalancer lb-svc --tcp 8080:8080 --dry-run=client -o yaml > lb-svc.yaml. section 6.4.3
  • In a kind cluster, install MetalLB and configure an IPAddressPool and L2Advertisement using addresses from the node network. section 6.4.3
  • Run kubectl get svc and confirm TYPE is LoadBalancer and EXTERNAL-IP contains an allocated address. section 6.4.3

Observed external access

A Service can report TYPE LoadBalancer, an external address such as 172.18.255.1, and port 80:30499/TCP. Curling the external address returns the application response. section 6.4.3

Figure 6.13 YAML that creates a LoadBalancer Service
figure

Use the YAML figure to compare the LoadBalancer manifest with ClusterIP and NodePort definitions. section 6.4.3

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Explains manifest creation, MetalLB configuration, and verification but defers load-balancer device internals.
Examples
Uses kubectl-generated YAML, MetalLB address-pool manifests, kubectl get svc output, and curl verification.
What it assumes
Assumes basic Kubernetes Services and cluster networking while teaching LoadBalancer creation from a generated manifest.
What you can do after
Operate and verify a LoadBalancer Service using kubectl, YAML, MetalLB, and an external request.
How it connects
Connects LoadBalancer Services with ClusterIP, NodePort, MetalLB, ingress, and CoreDNS.

Also explained in

Compare how 5 books explain loadbalancer service →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.