# A Service gives a stable way to reach a set of Pods, even as individual # Pods are created and destroyed and get new internal IP addresses over # time. This Service selects any Pod labelled app: demo (see # deployment.yaml) and forwards traffic to it. # # type: LoadBalancer asks the cluster for a real, dedicated IP address that # anything on your network can reach directly. On a cloud provider that # would provision an actual cloud load balancer; on bare metal there's # nothing to provision it, which is exactly the gap MetalLB # (apps/metallb.yaml) fills — it watches for LoadBalancer Services and # hands them an address from the pool configured in # apps/metallb/templates/ipaddresspool.yaml. Until that pool exists, this # Service's address will show as ; see docs/05-metallb.md. apiVersion: v1 kind: Service metadata: name: demo namespace: demo annotations: # Requests this specific address from MetalLB's pool, so it stays # predictable across rebuilds instead of getting whatever's next free. # Must fall inside the range in # apps/metallb/templates/ipaddresspool.yaml, or MetalLB will never # satisfy the request. metallb.io/loadBalancerIPs: "10.10.60.11" spec: type: LoadBalancer selector: app: demo ports: - port: 80 targetPort: 80