Skip to content

Commit 621e813

Browse files
committed
Documented NLB for Kubernetes 1.9
1 parent 38aefad commit 621e813

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

docs/concepts/services-networking/service.md

+54-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ metadata:
482482
cloud.google.com/load-balancer-type: "Internal"
483483
[...]
484484
```
485-
Use `cloud.google.com/load-balancer-type: "internal"` for masters with version 1.7.0 to 1.7.3.
485+
Use `cloud.google.com/load-balancer-type: "internal"` for masters with version 1.7.0 to 1.7.3.
486486
For more information, see the [docs](https://cloud.google.com/container-engine/docs/internal-load-balancing).
487487
{% endcapture %}
488488
@@ -577,6 +577,59 @@ annotation:
577577
Since version 1.3.0 the use of this annotation applies to all ports proxied by the ELB
578578
and cannot be configured otherwise.
579579

580+
#### Network Load Balancer support on AWS
581+
582+
To use a Network Load Balancer on AWS, add the following annotation:
583+
584+
```yaml
585+
metadata:
586+
name: my-service
587+
annotations:
588+
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
589+
```
590+
591+
Unlike classic Elastic Load Balancers, Network Load Balancers (NLBs) forward the
592+
client's IP through to the node. If a service's `spec.externalTrafficPolicy` set
593+
to `Cluster`, the client's IP address will not be propogated to the end pods.
594+
595+
By setting `spec.externalTrafficPolicy` to `Local`, client IP addresses will be
596+
propogated to the end pods, but this could result in uneven distribution of
597+
traffic. Nodes without any pods for a particular LoadBalancer service will fail
598+
the NLB Target Group's health check on the auto-assigned
599+
`spec.healthCheckNodePort` and not recieve any traffic.
600+
601+
In order to achieve even traffic, use either a DaemonSet, or specify a
602+
<a href="/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature">
603+
pod anti-affinity</a> to not locate pods on the same node.
604+
605+
NLB can also be used with the <a href="/docs/concepts/services-networking/service/#internal-load-balancer">
606+
internal load balancer</a> annotation.
607+
608+
In order for client traffic to reach instances behind an NLB, the Node security
609+
groups are modified with the following IP rules:
610+
611+
| Rule | Protocol | Port(s) | IpRange(s) | IpRange Description |
612+
|------|----------|---------|------------|---------------------|
613+
| Health Check | TCP | NodePort(s) (`spec.healthCheckNodePort` for `spec.externalTrafficPolicy = Local`) | VPC CIDR | kubernetes.io/rule/nlb/health=\<loadBalancerName\> |
614+
| Client Traffic | TCP | NodePort(s) | `spec.loadBalancerSourceRanges` (defaults to `0.0.0.0/0`) | kubernetes.io/rule/nlb/client=\<loadBalancerName\> |
615+
| MTU Discovery | ICMP | 3,4 | `spec.loadBalancerSourceRanges` (defaults to `0.0.0.0/0`) | kubernetes.io/rule/nlb/mtu=\<loadBalancerName\> |
616+
617+
Be aware that if `spec.loadBalancerSourceRanges` is not set, Kubernetes will
618+
allow traffic from `0.0.0.0/0` to the Node Security Group(s). If nodes have
619+
public IP addresses, be aware that non-NLB traffic can also reach all instances
620+
in those modified security groups.
621+
622+
In order to limit which client IP's can access the Network Load Balancer,
623+
specify `loadBalancerSourceRanges`.
624+
625+
```yaml
626+
spec:
627+
loadBalancerSourceRanges:
628+
- "143.231.0.0/16"
629+
```
630+
631+
NLB support was introduced Kubernetes 1.9.0.
632+
580633
### External IPs
581634

582635
If there are external IPs that route to one or more cluster nodes, Kubernetes services can be exposed on those

0 commit comments

Comments
 (0)