github.com/projectcontour/contour@v1.28.2/site/content/docs/main/guides/deploy-aws-nlb.md (about) 1 --- 2 title: Deploying Contour on AWS with NLB 3 --- 4 5 This is an advanced deployment guide to configure Contour on AWS with the [Network Load Balancer (NLB)][1]. 6 This configuration has several advantages: 7 8 1. NLBs are often cheaper. This is especially true for development. Idle LBs do not cost money. 9 2. There are no extra network hops. Traffic goes to the NLB, to the node hosting Contour, and then to the target pod. 10 3. Source IP addresses are retained. Envoy (running as part of Contour) sees the native source IP address and records this with an `X-Forwarded-For` header. 11 12 ## Moving parts 13 14 - We run Envoy as a DaemonSet across the cluster and Contour as a deployment 15 - The Envoy pod runs on host ports 80 and 443 on the node 16 - Host networking means that traffic hits Envoy without transitioning through any other fancy networking hops 17 - Contour also binds to 8001 for Envoy->Contour config traffic. 18 19 ## Deploying Contour 20 21 1. [Clone the Contour repository][4] and cd into the repo 22 2. Edit the Envoy service (`02-service-envoy.yaml`) in the `examples/contour` directory: 23 - Remove the existing annotation: `service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp` 24 - Add the following annotation: `service.beta.kubernetes.io/aws-load-balancer-type: nlb` 25 3. Run `kubectl apply -f examples/contour` 26 27 This creates the `projectcontour` Namespace along with a ServiceAccount, RBAC rules, Contour Deployment and an Envoy DaemonSet. 28 It also creates the NLB based loadbalancer for you. 29 30 You can get the address of your NLB via: 31 32 ``` 33 $ kubectl get service envoy --namespace=projectcontour -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 34 ``` 35 36 ## Test 37 38 You can now test your NLB. 39 40 1. Install a workload (see the kuard example in the [main deployment guide][2]). 41 2. Look up the address for your NLB in the AWS console and enter it in your browser. 42 - Notice that Envoy fills out `X-Forwarded-For`, because it was the first to see the traffic directly from the browser. 43 44 [1]: https://aws.amazon.com/blogs/aws/new-network-load-balancer-effortless-scaling-to-millions-of-requests-per-second/ 45 [2]: ../deploy-options/#testing-your-installation 46 [3]: https://github.com/kubernetes/kubernetes/issues/52173 47 [4]: {{< param github_url >}}/tree/{{< param branch >}}