Skip to main content
To expose a Workload, create a Kubernetes Service of type LoadBalancer. This page covers the one required field and the annotations LKS supports. For the model behind it, see Exposing Workloads.

Required: the LoadBalancer class

Every LKS LoadBalancer Service must set spec.loadBalancerClass to latitude.sh/elastic-ip. Without it, the Service never receives an external IP and its EXTERNAL-IP stays <pending>.
Apply it and read back the assigned address:
A Latitude Elastic IP is allocated in the Cluster’s region and, once it’s announced, populates EXTERNAL-IP.

Preserve the client source IP

To keep the Service highly available and preserve the client source IP, set externalTrafficPolicy: Local and run at least two replicas across Nodes. See High availability.

Annotations

LKS supports two annotations for controlling the Elastic IP behind a Service.

Adopting an Elastic IP

The Elastic IP you adopt must belong to the same project and region as the Cluster and be a BGP-mode address that isn’t already in use. If it doesn’t qualify, the Service stays pending and the platform records the reason as an event on the Service:

Preserving an Elastic IP

A preserved Elastic IP stays reserved after you delete the Service, and reserved Elastic IPs continue to bill. Release it when you no longer need the address.