@@ -482,7 +482,7 @@ metadata:
482
482
cloud.google.com/load-balancer-type: "Internal"
483
483
[...]
484
484
` ` `
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.
486
486
For more information, see the [docs](https://cloud.google.com/container-engine/docs/internal-load-balancing).
487
487
{% endcapture %}
488
488
@@ -577,6 +577,59 @@ annotation:
577
577
Since version 1.3.0 the use of this annotation applies to all ports proxied by the ELB
578
578
and cannot be configured otherwise.
579
579
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
+
580
633
# ## External IPs
581
634
582
635
If there are external IPs that route to one or more cluster nodes, Kubernetes services can be exposed on those
0 commit comments