Skip to content

Commit 2b3ec7e

Browse files
Apply suggestions from code review
Co-authored-by: Alan Dooley <[email protected]>
1 parent 25f5869 commit 2b3ec7e

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

content/nginx/deployment-guides/amazon-web-services/ingress-controller-elastic-kubernetes-services.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ toc: true
1010
weight: 400
1111
---
1212

13-
This guide explains how to use NGINX Open Source or F5 NGINX Plus Ingress Controller for Amazon Elastic Kubernetes Services (EKS).
13+
This guide explains how to use NGINX or F5 NGINX Plus with NGINX Ingress Controller for Amazon Elastic Kubernetes Services (EKS).
1414

15-
**Note:** These instructions apply to both the NGINX and NGINX Plus Ingress Controllers for Kubernetes. For ease of reading, the document refers to NGINX Plus only.
15+
{{< note >}} These instructions apply to NGINX Ingress Controller with NGINX or NGINX Plus. For ease of reading, the document refers to NGINX Plus only. {{< /note >}}
1616

1717

1818
<span id="prereqs"></span>
@@ -23,13 +23,13 @@ This guide explains how to use NGINX Open Source or F5 NGINX Plus Ingress Contro
2323
- For NGINX Open Source you can use the pre-built image [on DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/). You can also build your own image.
2424
- For NGINX Plus, you must build an image.
2525

26-
**Note:** If you build the image, do not push it to a public registry. Run the <span style="white-space: nowrap;">`make` `container`</span> command below.
26+
{{< note >}} If you build the image, do not push it to a public registry. Run the `make container` command below. {{< /note >}}
2727

2828
```shell
2929
make container DOCKERFILE=DockerfileForPlus PREFIX=nginx/nginx-plus-ingress
3030
```
3131

32-
The `PREFIX` argument specifies the repo name in your private container registry. In this example, we set it to <span style="white-space: nowrap; font-weight:bold;">nginx/nginx-plus-ingress</span>. You can later use that name to reference the image instead of its numerical ID.
32+
The `PREFIX` argument specifies the repo name in your private container registry. In this example, we set it to `nginx/nginx-plus-ingress`. You can later use that name to reference the image instead of its numerical ID.
3333

3434

3535
<span id="amazon-eks"></span>
@@ -52,21 +52,21 @@ This step is only required if you do not plan to use the prebuilt NGINX Open Sou
5252

5353
1. Use the [AWS documentation](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-create.html) to create a repository in the Amazon Elastic Container Registry (ECR). In Step 4 of the AWS instructions, name the repository <span style="white-space: nowrap; font-weight:bold;">nginx-plus-ic</span> as that is what we use in this guide.
5454

55-
2. Run the following AWS CLI command. It generates an auth token for your AWS ECR registry and pipes it into the <span style="white-space: nowrap;">`docker` `login`</span> command. This lets AWS ECR authenticate and authorize the upcoming Docker requests. For details about the command, see the [AWS documentation](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html).
55+
2. Run the following AWS CLI command. It generates an auth token for your AWS ECR registry, then pipes it into the `docker login` command. This lets AWS ECR authenticate and authorize the upcoming Docker requests. For details about the command, see the [AWS documentation](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html).
5656

5757
```shell
5858
aws ecr get-login-password --region <aws_region_code> | docker login --username AWS --password-stdin <aws_account_id>.dkr.ecr.<aws_region_code>.amazonaws.com
5959
```
6060
- `<aws_region_code>` is the same region name you specified in Step 2 above.
6161
- `<aws_account_id>` is your AWS account number. For instructions on retrieving the ID, see the [AWS documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html).
6262

63-
3. Run the following command to apply the tag `edge` to your NGINX Plus Ingress Controller image:
63+
3. Run the following command to apply the tag `edge` to your NGINX Ingress Controller image:
6464

6565
```shell
6666
docker tag <registry/image>:edge <aws_account_id>.dkr.ecr.<aws-region-code>.amazonaws.com/<ecr_repo>:edge
6767
```
68-
- `<registry/image>` is the repo name you set with the `PREFIX` parameter to the <span style="white-space: nowrap;">`make` `container`</span> command (see [Prerequisites](#prereqs)). In this guide it is <span style="white-space: nowrap;">`nginx/nginx-plus-ingress`</span>.
69-
- `<ecr_repo>` is the AWS ECR repository you created in Step 1 above. In this guide it is called <span style="white-space: nowrap;">`nginx-plus-ic`</span>.
68+
- `<registry/image>` is the repo name you set with the `PREFIX` parameter to the `make container` command (see [Prerequisites](#prereqs)). In this guide it is `nginx/nginx-plus-ingress`.
69+
- `<ecr_repo>` is the AWS ECR repository you created in Step 1 above. In this guide it is called `nginx-plus-ic`.
7070

7171
The final command is:
7272

@@ -85,28 +85,29 @@ This step is only required if you do not plan to use the prebuilt NGINX Open Sou
8585

8686
Use [our documentation](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/) to install the NGINX Plus Ingress Controller in your Amazon EKS cluster.
8787

88-
Complete the steps up to and including [Confirm NGINX Ingress Controller is running](https://docs.nginx.com/nginx-ingress-controller/installation/installing-nic/installation-with-manifests/#confirm-nginx-ingress-controller-is-running). Next, follow the instructions below to create a Network Load Balancer to route traffic to the NGINX Plus Ingress Controller.
88+
Complete the steps up to and including [Confirm NGINX Ingress Controller is running](https://docs.nginx.com/nginx-ingress-controller/installation/installing-nic/installation-with-manifests/#confirm-nginx-ingress-controller-is-running). Next, follow the instructions below to create a Network Load Balancer to route traffic to NGINX Plus Ingress Controller.
8989

90-
<span id="nlb"></span>
91-
## Using a Network Load Balancer in Front of the NGINX Plus Ingress Controller
90+
---
91+
92+
## Use a Network Load Balancer in front of NGINX Ingress Controller
9293

93-
We assume you've cloned the [kubernetes-ingress](https://github.com/nginx/kubernetes-ingress) repository in the previous step.
94+
These steps assume you've cloned the [kubernetes-ingress](https://github.com/nginx/kubernetes-ingress) repository in the previous step.
9495

95-
We need a Kubernetes `LoadBalancer` service to route traffic to the NGINX Plus Ingress Controller. By default, Amazon EKS will create a [Classic Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html) for Kubernetes services of type `LoadBalancer`. However, we recommend that you create a [Network Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html) (NLB). It operates at the transport layer and is optimized for high performance and low latency.
96+
You need a Kubernetes `LoadBalancer` service to route traffic to the NGINX Ingress Controller. By default, Amazon EKS will create a [Classic Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html) for Kubernetes services of type `LoadBalancer`. However, we recommend that you create a [Network Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html) (NLB). It operates at the transport layer and is optimized for high performance and low latency.
9697

9798
We also recommend enabling the PROXY Protocol for both the NGINX Plus Ingress Controller and your NLB target groups. This is used to forward client connection information. If you choose not to enable the PROXY protocol, see the [Appendix](#appendix).
9899

99100
### Configuring a `LoadBalancer` Service to Use NLB
100101

101-
Apply the manifest <span style="white-space: nowrap; font-weight:bold;">deployments/service/loadbalancer-aws-elb.yaml</span> to create a `LoadBalancer` of type NLB:
102+
Apply the manifest `deployments/service/loadbalancer-aws-elb.yaml` to create a `LoadBalancer` of type NLB:
102103

103104
```shell
104105
kubectl apply -f deployments/service/loadbalancer-aws-elb.yaml
105106
```
106107

107108
### Enabling the PROXY Protocol
108109

109-
1. Add the following keys to the <span style="white-space: nowrap; font-weight:bold;">deployments/common/nginx-config.yaml</span> config map file:
110+
1. Add the following keys to the `deployments/common/nginx-config.yaml` config map file:
110111

111112
```yaml
112113
proxy-protocol: "True"
@@ -138,18 +139,18 @@ Apply the manifest <span style="white-space: nowrap; font-weight:bold;">deployme
138139
nslookup <dns-name>
139140
```
140141

141-
3. Follow the [instructions](https://github.com/nginx/kubernetes-ingress/tree/main/examples/ingress-resources/complete-example) to deploy our Cafe demo app into the EKS cluster. It will be load balanced by your NGINX Plus Ingress Controller.
142+
3. Follow the [instructions](https://github.com/nginx/kubernetes-ingress/tree/main/examples/ingress-resources/complete-example) to deploy the Cafe demo app into the EKS cluster. It will be load balanced by NGINX Ingress Controller.
142143
* In Step 1 of deploying the demo app, save the public IP address into the `IC_IP` shell variable. Set `IC_HTTPS_PORT` to 443.
143-
* The `kubectl` commands are relative to the <span style="white-space: nowrap; font-weight:bold;">deployment/examples/ingress-resources/complete-example</span> directory of the [kubernetes-ingress](https://github.com/nginx/kubernetes-ingress) repository.
144+
* The `kubectl` commands are relative to the `deployment/examples/ingress-resources/complete-example` directory of the [kubernetes-ingress](https://github.com/nginx/kubernetes-ingress) repository.
144145
* Run the `curl` command listed in the instructions. It will access the demo app and populate the NGINX Plus Ingress Controller logs.
145146

146147
4. Run the following commands to check if the PROXY Protocol is enabled:
147-
1. Display the name of the running pod of the NGINX Plus Ingress Controller:
148+
1. Display the pod of NGINX Ingress Controller:
148149

149150
```shell
150151
kubectl get pods -n nginx-ingress
151152
```
152-
2. Display the logs from the NGINX Plus Ingress Controller. Replace `<pod_name>` with the name from the previous step. If the logged IP address matches the one you used to access the demo app, then the PROXY Protocol is enabled.
153+
2. Display the logs from NGINX Ingress Controller. Replace `<pod_name>` with the name from the previous step. If the logged IP address matches the one you used to access the demo app, then the PROXY Protocol is enabled.
153154

154155
```shell
155156
kubectl logs <pod_name> -n nginx-ingress
@@ -163,7 +164,7 @@ If you want to disable the PROXY Protocol, perform these steps.
163164

164165
1. Disable the PROXY Protocol for the target groups linked to the NLB. Undo the steps in the **Enable proxy protocol** section of the [AWS documentation](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/edit-target-group-attributes.html#proxy-protocol).
165166

166-
2. Remove the following keys from <span style="white-space: nowrap; font-weight:bold;">deployments/common/nginx-config.yaml</span> the config map file:
167+
2. Remove the following keys from `deployments/common/nginx-config.yaml` the config map file:
167168

168169
```yaml
169170
proxy-protocol: "True"
@@ -177,7 +178,7 @@ If you want to disable the PROXY Protocol, perform these steps.
177178
kubectl apply -f deployments/common/nginx-config.yaml
178179
```
179180

180-
3. In the <span style="white-space: nowrap; font-weight:bold;">deployments/service/loadbalancer-aws-elb.yaml</span> service file, add the `externalTrafficPolicy` key in the `spec` section. Set it to `Local`, as in this example:
181+
3. In the `deployments/service/loadbalancer-aws-elb.yaml` service file, add the `externalTrafficPolicy` key in the `spec` section. Set it to `Local`, as in this example:
181182

182183
```yaml
183184
apiVersion: v1

0 commit comments

Comments
 (0)