Skip to content

Commit 0c5aa3c

Browse files
author
Timo Reimann
authored
Merge pull request #269 from digitalocean/improve-docs-around-via-lb-requests
Improve doc section about via-LB requests
2 parents 58a3698 + 8fc4c68 commit 0c5aa3c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

docs/controllers/services/examples/README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,20 @@ ID IP Name
9999

100100
```
101101

102-
## HTTPS or HTTP2 Load Balancer with Hostname
102+
## Accessing pods over a managed load-balancer from inside the cluster
103103

104-
The `service.beta.kubernetes.io/do-loadbalancer-hostname` annotation can be used to specify the hostname used for the Service `status.Hostname` instead of assigning `status.IP` directly. This is useful as a workaround for the issue of [kube-proxy adding external LB address to node local iptables rule](https://github.com/kubernetes/kubernetes/issues/66607), which will break requests to an LB from in-cluster if the LB is expected to terminate SSL or proxy protocol.
104+
Because of an existing [limitation in upstream Kubernetes](https://github.com/kubernetes/kubernetes/issues/66607), pods cannot talk to other pods via the IP address of an external load-balancer set up through a `LoadBalancer`-typed service. Kubernetes will cause the LB to be bypassed, potentially breaking workflows that expect TLS termination or proxy protocol handling to be applied consistently.
105105

106-
The workflow for this scenario is generally:
106+
A workaround is to set up a DNS record for a custom hostname (at a provider of your choice) and have it point to the external IP address of the load-balancer. The clients would then speak to the service over the hostname (i.e., the load-balancer). To further simplify consumption of the hostname within a cluster, _digitalocean-cloud-controller-manager_ may be instructed to return the custom hostname (instead of the external LB IP address) in the service ingress status. This is done by specifying the hostname in the `service.beta.kubernetes.io/do-loadbalancer-hostname` annotation and retrieving the service's `status.Hostname` field afterwards.
107+
108+
Note that setting `service.beta.kubernetes.io/do-loadbalancer-hostname` is not a requirement. You may also register additional hostnames and have them all point at the IP address.
109+
110+
The workflow for setting up the `service.beta.kubernetes.io/do-loadbalancer-hostname` annotation is generally:
107111

108112
1. Deploy the manifest with your Service (example below).
109-
1. Wait for the service external IP to be available.
110-
1. Add a DNS record for your hostname pointing to the external IP.
111-
1. Add the hostname annotation to your manifest (example below). Deploy it.
113+
2. Wait for the service external IP to be available.
114+
3. Add a DNS record for your hostname pointing to the external IP.
115+
4. Add the hostname annotation to your manifest (example below). Deploy it.
112116

113117
```yaml
114118
kind: Service

0 commit comments

Comments
 (0)