liveBook · Manning

Internal load balancing

As explained in Google Anthos in Action

An internal load balancer distributes traffic originating within a Google Cloud VPC network to cluster nodes or workloads.

An internal load balancer gives applications in the same Google Cloud VPC network an IP address for reaching a GKE Service. It selects that address from the cluster’s VPC subnet rather than assigning an external IP address. section 10.2.1

In GKE, internal and external network load balancers handle TCP/L4 traffic. Both use Google Cloud forwarding rules to route traffic to a Kubernetes node. Choose an internal load balancer for traffic originating within the VPC; an external load balancer serves traffic from outside it. HTTP(S) load balancing instead uses an Ingress resource. section 10.2.1

apiVersion: v1
kind: Service
metadata:
  name: ilb-service
  annotations:
    cloud.google.com/load-balancer-type: "Internal"  #1
  labels:
    app: hello
spec:
  type: LoadBalancer                                 #2
  selector:
    app: hello
  ports:
  - port: 80
    targetPort: 8080
    protocol: TCP

Set the Service type to LoadBalancer and add the cloud.google.com/load-balancer-type: "Internal" annotation. The example exposes TCP port 80 and targets port 8080 on selected workloads. section 10.2.1

How Google Anthos in Action covers it

How deep it goes
Explains subnet IP selection and forwarding-rule routing, then shows the Service configuration; stops short of a deployment walkthrough.
Examples
Shows a Service manifest with an Internal annotation, a LoadBalancer type, and TCP port mapping.
What it assumes
Assumes familiarity with Kubernetes Services and Google Cloud VPC networking; supplies the required Service fields.
What you can do after
Operate/configure it by annotating a GKE LoadBalancer Service for access from the same VPC network.
How it connects
Connects Kubernetes Services, VPC subnets, forwarding rules, external load balancers, and HTTP(S) Ingress.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Google Anthos in Action. The section links point to the parts of the book it draws on.