Add deployment docs for AWS NLB (#1785)
This commit is contained in:
parent
93c72ef646
commit
cd9624584d
2 changed files with 51 additions and 0 deletions
|
@ -108,6 +108,11 @@ nginx-ingress-controller-fdcdcd6dd-vvpgs 1/1 Running 0 11s
|
||||||
### AWS
|
### AWS
|
||||||
|
|
||||||
In AWS we use an Elastic Load Balancer (ELB) to expose the NGINX Ingress controller behind a Service of `Type=LoadBalancer`.
|
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 network load balancer (NLB)
|
||||||
|
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:
|
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.
|
- [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
|
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
|
### GCE - GKE
|
||||||
|
|
||||||
Patch the nginx ingress controller deployment to add the flag `--publish-service`
|
Patch the nginx ingress controller deployment to add the flag `--publish-service`
|
||||||
|
|
23
deploy/provider/aws/service-nlb.yaml
Normal file
23
deploy/provider/aws/service-nlb.yaml
Normal file
|
@ -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
|
Loading…
Reference in a new issue