From 95abc6ee9c3c4cd281da351ddbb946170957aa2b Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Sat, 25 Nov 2017 19:19:35 -0300 Subject: [PATCH] Add deployment docs for AWS NLB --- deploy/README.md | 28 ++++++++++++++++++++++++++++ deploy/provider/aws/service-nlb.yaml | 23 +++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 deploy/provider/aws/service-nlb.yaml diff --git a/deploy/README.md b/deploy/README.md index 8f7c22c752..8589fbcc71 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -108,6 +108,11 @@ nginx-ingress-controller-fdcdcd6dd-vvpgs 1/1 Running 0 11s ### AWS In AWS we use an Elastic Load Balancer (ELB) to expose the NGINX Ingress controller behind a Service of `Type=LoadBalancer`. +Since Kubernetes v1.9.0 it is possible to use a classic load balancer (ELB) or +Please check the [elastic load balancing AWS details page](https://aws.amazon.com/es/elasticloadbalancing/details/) + +#### Elastic Load Balancer - ELB + This setup requires to choose in which layer (L4 or L7) we want to configure the ELB: - [Layer 4](https://en.wikipedia.org/wiki/OSI_model#Layer_4:_Transport_Layer): use TCP as the listener protocol for ports 80 and 443. @@ -153,6 +158,29 @@ If not run: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/patch-service-without-rbac.yaml ``` +#### Network Load Balancer (NLB) + +This type of load balancer is supported since v1.9.0 as an ALPHA feature. + +```console +kubectl patch deployment -n ingress-nginx nginx-ingress-controller --type='json' \ + --patch="$(curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/patch-deployment.yaml)" + +kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/aws/service-nlb.yaml +``` + +If the ingress controller uses RBAC run: + +```console +kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/patch-service-with-rbac.yaml +``` + +If not run: + +```console +kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/patch-service-without-rbac.yaml +``` + ### GCE - GKE Patch the nginx ingress controller deployment to add the flag `--publish-service` diff --git a/deploy/provider/aws/service-nlb.yaml b/deploy/provider/aws/service-nlb.yaml new file mode 100644 index 0000000000..3db8dc4d5b --- /dev/null +++ b/deploy/provider/aws/service-nlb.yaml @@ -0,0 +1,23 @@ +kind: Service +apiVersion: v1 +metadata: + name: ingress-nginx + namespace: ingress-nginx + labels: + app: ingress-nginx + annotations: + # by default the type is elb (classic load balancer). + service.beta.kubernetes.io/aws-load-balancer-type: nlb +spec: + # this setting is t make sure the source IP address is preserved. + externalTrafficPolicy: Local + type: LoadBalancer + selector: + app: ingress-nginx + ports: + - name: http + port: 80 + targetPort: http + - name: https + port: 443 + targetPort: https