You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/custom-resources/rate-limit-tiered-apikey/README.md
+27-27Lines changed: 27 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,28 +8,28 @@ limit Policies, grouped in a tier, using the API Key client name as the key to t
8
8
## Prerequisites
9
9
10
10
1. Follow the [installation](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/)
11
-
instructions to deploy the Ingress Controller.
12
-
1. Save the public IP address of the Ingress Controller into a shell variable:
11
+
instructions to deploy NGINX Ingress Controller.
12
+
2. Save the public IP address of NGINX Ingress Controller into a shell variable:
13
13
14
-
```console
15
-
IC_IP=XXX.YYY.ZZZ.III
16
-
```
17
-
18
-
1. Save the HTTP port of the Ingress Controller into a shell variable:
19
-
20
-
```console
21
-
IC_HTTP_PORT=<port number>
22
-
```
14
+
```shell
15
+
IC_IP=XXX.YYY.ZZZ.III
16
+
```
17
+
<!-- markdownlint-disable MD029 -->
18
+
3. Save the HTTP port of the Ingress Controller into a shell variable:
19
+
<!-- markdownlint-enable MD029 -->
20
+
```shell
21
+
IC_HTTP_PORT=<port number>
22
+
```
23
23
24
-
## Step 1 - Deploy a Web Application
24
+
## Deploy a web application
25
25
26
26
Create the application deployments and services:
27
27
28
-
```console
28
+
```shell
29
29
kubectl apply -f coffee.yaml
30
30
```
31
31
32
-
## Step 2 - Deploy the Rate Limit Policies
32
+
## Deploy the Rate Limit Policies
33
33
34
34
In this step, we create three Policies:
35
35
@@ -41,37 +41,37 @@ The `rate-limit-apikey-basic` Policy is also the default policy if the API Key c
41
41
42
42
Create the policies:
43
43
44
-
```console
44
+
```shell
45
45
kubectl apply -f api-key-policy.yaml
46
46
kubectl apply -f rate-limits.yaml
47
47
```
48
48
49
-
## Step 3 - Deploy the API Key Auth Secret
49
+
## Deploy the API Key Secret
50
50
51
51
Create a secret of type `nginx.org/apikey` with the name `api-key-client-secret` that will be used for authorization on the server level.
52
52
53
53
This secret will contain a mapping of client names to base64 encoded API Keys.
54
54
55
-
```console
55
+
```shell
56
56
kubectl apply -f api-key-secret.yaml
57
57
```
58
58
59
-
## Step 4 - Configure Load Balancing
59
+
## Configure Load Balancing
60
60
61
61
Create a VirtualServer resource for the web application:
62
62
63
-
```console
63
+
```shell
64
64
kubectl apply -f cafe-virtual-server.yaml
65
65
```
66
66
67
67
Note that the VirtualServer references the policies `api-key-policy`, `rate-limit-apikey-premium` & `rate-limit-apikey-basic` created in Step 2.
68
68
69
-
## Step 5 - Test the Premium Configuration
69
+
## Test the premium configuration
70
70
71
71
Let's test the configuration. If you access the application with an API Key in an expected header at a rate that exceeds 5 requests per second, NGINX will
@@ -95,14 +95,14 @@ Server name: coffee-dc88fc766-zr7f8
95
95
96
96
> Note: The command result is truncated for the clarity of the example.
97
97
98
-
## Step 6 - Test the Basic Configuration
98
+
## Test the basic configuration
99
99
100
-
This test is similar to Step 5, however, this time we will be setting the API Key in the header to a value that maps to the `client1-basic` client name.
100
+
This test is similar to the previous step, however, this time we will be setting the API Key in the header to a value that maps to the `client1-basic` client name.
101
101
102
102
Let's test the configuration. If you access the application at a rate that exceeds 1 request per second, NGINX will
@@ -126,14 +126,14 @@ Server name: coffee-dc88fc766-zr7f8
126
126
127
127
> Note: The command result is truncated for the clarity of the example.
128
128
129
-
## Step 7 - Test the default Configuration
129
+
## Test the default configuration
130
130
131
-
This test is similar to Step 5 & 6, however, this time we will setting the API Key in the header to a value that maps to the `random` client name, which matches neither of the regex patterns configured in the Policies. However, we will still be seeing the default `rate-limit-apikey-basic` Policy applied.
131
+
This test is similar to the previous two steps, however, this time we will setting the API Key in the header to a value that maps to the `random` client name, which matches neither of the regex patterns configured in the Policies. However, we will still be seeing the default `rate-limit-apikey-basic` Policy applied.
132
132
133
133
Let's test the configuration. If you access the application at a rate that exceeds 1 request per second, NGINX will
Copy file name to clipboardExpand all lines: examples/custom-resources/rate-limit-tiered-request-method/README.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,28 +6,28 @@ limit Policies, grouped in a tier, using the client IP address as the key to the
6
6
## Prerequisites
7
7
8
8
1. Follow the [installation](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/)
9
-
instructions to deploy the Ingress Controller.
10
-
1. Save the public IP address of the Ingress Controller into a shell variable:
9
+
instructions to deploy NGINX Ingress Controller.
10
+
2. Save the public IP address of NGINX Ingress Controller into a shell variable:
11
11
12
-
```console
13
-
IC_IP=XXX.YYY.ZZZ.III
14
-
```
15
-
16
-
1. Save the HTTP port of the Ingress Controller into a shell variable:
17
-
18
-
```console
19
-
IC_HTTP_PORT=<port number>
20
-
```
12
+
```shell
13
+
IC_IP=XXX.YYY.ZZZ.III
14
+
```
15
+
<!-- markdownlint-disable MD029 -->
16
+
3. Save the HTTP port of the Ingress Controller into a shell variable:
17
+
<!-- markdownlint-enable MD029 -->
18
+
```shell
19
+
IC_HTTP_PORT=<port number>
20
+
```
21
21
22
-
## Step 1 - Deploy a Web Application
22
+
## Deploy a web application
23
23
24
24
Create the application deployments and services:
25
25
26
-
```console
26
+
```shell
27
27
kubectl apply -f coffee.yaml
28
28
```
29
29
30
-
## Step 2 - Deploy the Rate Limit Policies
30
+
## Deploy the Rate Limit Policies
31
31
32
32
In this step, we create two Policies:
33
33
@@ -38,26 +38,26 @@ The `rate-limit-request-method-put-post-patch-delete` Policy is also the default
38
38
39
39
Create the policies:
40
40
41
-
```console
41
+
```shell
42
42
kubectl apply -f rate-limits.yaml
43
43
```
44
44
45
-
## Step 3 - Configure Load Balancing
45
+
## Configure Load Balancing
46
46
47
47
Create a VirtualServer resource for the web application:
48
48
49
-
```console
49
+
```shell
50
50
kubectl apply -f cafe-virtual-server.yaml
51
51
```
52
52
53
53
Note that the VirtualServer references the policies `rate-limit-request-method-get-head` & `rate-limit-request-method-put-post-patch-delete` created in Step 2.
54
54
55
-
## Step 4 - Test the Configuration
55
+
## Test the configuration
56
56
57
57
Let's test the configuration. If you access the application at a rate that exceeds 5 requests per second with a `GET` request method, NGINX will
0 commit comments