LoadBalancer Service. Use this approach when you need workloads in your cluster to be reachable from outside the cluster over a public IPv4 address, and optionally a public DNS name.
One way to expose Pods on CKS to the public Internet is to use a LoadBalancer Service. These Services expose Pods to the Internet through public IPv4 addresses. You can also assign public DNS names to them.
HTTP and HTTPS quickstart
Choose the approach that matches the traffic you need to expose:- Plain TCP, or HTTP without edge TLS: use a
LoadBalancerService, which exposes a Pod over a public IPv4 address on any TCP or UDP port. Use this for plain TCP workloads such as SSH, or for HTTP services that don’t need TLS termination at the edge. TheLoadBalancerService manifest on this page covers the HTTP case: setportandtargetPortto your application’s HTTP port instead of the SSH port shown. - HTTP or HTTPS routed by hostname, with TLS termination: use a Traefik Ingress, which routes traffic by hostname with TLS termination. Traefik terminates TLS using a certificate that
cert-managerissues, so you don’t expose each backend Service directly. For setup, see Traefik and Cert-manager. To assign a stable public DNS name, see Create a public DNS name.
LoadBalancer Service.
Create a Load Balancer Service
To expose your Pods, you must create aLoadBalancer Service manifest and deploy it to your cluster. The following sections walk through each part of that process.
Create the manifest
To create a Service oftype: LoadBalancer, deploy a Service manifest onto CKS. The following sample manifest defines a LoadBalancer Service that exposes an sshd Pod on port 22:
loadbalancer-example.yaml
- The Service (
example-sshd) is configured astype: LoadBalancer. - The
coreweave-load-balancer-typeannotation ispublic.
The public address assigned to the Service comes from CoreWeave’s public LoadBalancer address pool for the Region and remains stable for the lifetime of the Service. This pool is separate from the Region’s NAT egress range, which governs only outbound traffic.
Deploy the manifest
After you save the manifest, apply it to your cluster so that CKS provisions the Load Balancer. Apply the manifest withkubectl. For example:
Locate the IPv4 address
After you deploy the Service, you need its assigned public IPv4 address to reach the Pods from outside the cluster. After you apply the manifest, usedescribe to see the deployed Service. For example:
LoadBalancer Ingress field. With this address, the Pods that the Service selects are now reachable from the public Internet on the ports that the manifest defines.
For more information, see the official Kubernetes documentation.
Choose public or private addressing
Theservice.beta.kubernetes.io/coreweave-load-balancer-type annotation controls whether the Service gets a public or a private address:
public: assigns an internet-facing public IP from the Region’s public LoadBalancer pool. Use this when external clients must reach the Service.- Annotation absent: assigns a private (RFC 1918) address. This address is reachable from within the cluster, and over a connected VPC or Direct Connect, but not from the public Internet.
internal. CoreWeave doesn’t recognize internal as a value, and a Service with that value can stay in <Pending> indefinitely. To request a private address, omit the annotation entirely.
Restrict access by source IP
Thespec.loadBalancerSourceRanges field restricts external traffic to a public LoadBalancer Service to the client IP ranges you specify. CKS silently drops traffic from sources outside those ranges, so blocked connection attempts time out instead of returning a connection-refused error. If you omit the field or leave the list empty, no source-IP restriction applies.
Use this procedure for a Service that you manage in CKS. You need its manifest and kubectl access to update it. Specify the allowed client IP ranges in classless inter-domain routing (CIDR) notation.
1
Add the allowed IP ranges
Add
loadBalancerSourceRanges to your Service manifest. Replace [ALLOWED-CIDR] with an allowed IPv4 network range. To allow a single IPv4 address, use a /32 suffix. Add a list entry for each allowed range.The following excerpt shows the fields to set. Preserve all other fields in your Service manifest:2
Apply the updated manifest
Replace
[SERVICE-MANIFEST] with the path to your Service manifest:3
Test allowed and excluded clients
Test connections to the Service’s public IP and port from two clients outside the cluster. Use one client in an allowed range and one outside all allowed ranges.The allowed client should reach the application, and the excluded client should time out. A test from a Pod inside the cluster doesn’t verify external source-IP restrictions.
kubeApiAccess.public.allowCidrs in the Update Cluster API. That API setting is separate from Service access and doesn’t filter the legacy public API ingress.
For a short answer, see How do I restrict which IPs can reach my LoadBalancer Service?.
Pin a Service to an address pool
On clusters with multiple LoadBalancer address pools, the first pool is the default and Services allocate from it automatically. To allocate from a non-default pool, add the address-pool label to the Service. Replace[POOL-NAME] with the name of the address pool:
pool_selector_mismatch and the condition cilium.io/IPAMRequestSatisfied: False. Add the lb.coreweave.com/address-pool label that selects the pool containing the IP.
To request a specific IP, use the Cilium annotation. Replace [SPECIFIC-IP] with the IP address you want to assign:
metallb.universe.tf/address-pool: public annotation. On those clusters, if the dedicated pool is exhausted, you can switch a Service to the shared pool by replacing that annotation with service.beta.kubernetes.io/coreweave-load-balancer-type: public.
LoadBalancer IP stability
A LoadBalancer Service IP is pinned for the lifetime of the Service object. The following actions release the IP, with no guarantee that you get the same address back:- Deleting the Service.
- Changing the Service type away from
LoadBalancer. - Removing the
coreweave-load-balancer-type: publicannotation from a public Service.
Layer 4 and Layer 7 traffic
CoreWeave LoadBalancer Services operate at Layer 4 (TCP and UDP). For Layer 7 features such as path-based routing or TLS termination, run an ingress controller such as Traefik behind the LoadBalancer.Troubleshoot an unreachable service
If the Service doesn’t respond after you deploy it, check the following:- No external IP yet. Run
kubectl describe services example-sshdand confirm theLoadBalancer Ingressfield shows an address. CKS assigns the address from the Region’s public LoadBalancer address pool. If the field is empty, the Load Balancer is still provisioning. Confirm theservice.beta.kubernetes.io/coreweave-load-balancer-type: publicannotation is present so the Service requests a public address. - Wrong
externalTrafficPolicy. WithexternalTrafficPolicy: Local, traffic only reaches Nodes that run a Pod the Service selects. Confirm the Serviceselectormatches your Pod labels and that at least one selected Pod is running andReady. If no selected Pod runs on a Node, that Node drops the traffic. - Source IP excluded. If
spec.loadBalancerSourceRangesis set, confirm the external client’s source IP is in an allowed range. An excluded connection times out. See Restrict access by source IP. - DNS not resolved. If you assigned a public DNS name, the fully qualified domain name (FQDN) can take time to propagate. Confirm the record resolves before you rely on it, and retrieve the allocated name from the Service status. For details, see Create a public DNS name.
Troubleshoot in-cluster versus external reachability
If the LoadBalancer IP works inside the cluster but external clients can’t reach it, check for a private address or source-IP restrictions. A platform-side route advertisement issue can also cause this behavior. Test the same IP from a Pod and from outside the cluster, then match your result to the discriminator table. Test from inside the cluster. Replace[LB-IP] and [PORT] with the LoadBalancer’s IP address and port: