File tree Expand file tree Collapse file tree 8 files changed +491
-87
lines changed
site/content/how-to/traffic-management Expand file tree Collapse file tree 8 files changed +491
-87
lines changed Original file line number Diff line number Diff line change 1
1
# SnippetsFilter
2
2
3
- This directory contains example YAMLs for testing SnippetsFilter. Eventually, this will be converted into a how-to guide.
3
+ This directory contains the YAML files used in the [ SnippetsFilter ] ( https://docs.nginx.com/nginx-gateway-fabric/ how-to/traffic-management/snippets-filters/ ) guide.
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : coffee
5
+ spec :
6
+ replicas : 1
7
+ selector :
8
+ matchLabels :
9
+ app : coffee
10
+ template :
11
+ metadata :
12
+ labels :
13
+ app : coffee
14
+ spec :
15
+ containers :
16
+ - name : coffee
17
+ image : nginxdemos/nginx-hello:plain-text
18
+ ports :
19
+ - containerPort : 8080
20
+ ---
21
+ apiVersion : v1
22
+ kind : Service
23
+ metadata :
24
+ name : coffee
25
+ spec :
26
+ ports :
27
+ - port : 80
28
+ targetPort : 8080
29
+ protocol : TCP
30
+ name : http
31
+ selector :
32
+ app : coffee
33
+ ---
34
+ apiVersion : apps/v1
35
+ kind : Deployment
36
+ metadata :
37
+ name : tea
38
+ spec :
39
+ replicas : 1
40
+ selector :
41
+ matchLabels :
42
+ app : tea
43
+ template :
44
+ metadata :
45
+ labels :
46
+ app : tea
47
+ spec :
48
+ containers :
49
+ - name : tea
50
+ image : nginxdemos/nginx-hello:plain-text
51
+ ports :
52
+ - containerPort : 8080
53
+ ---
54
+ apiVersion : v1
55
+ kind : Service
56
+ metadata :
57
+ name : tea
58
+ spec :
59
+ ports :
60
+ - port : 80
61
+ targetPort : 8080
62
+ protocol : TCP
63
+ name : http
64
+ selector :
65
+ app : tea
Original file line number Diff line number Diff line change
1
+ apiVersion : gateway.nginx.org/v1alpha1
2
+ kind : SnippetsFilter
3
+ metadata :
4
+ name : coffee-rate-limiting-sf
5
+ spec :
6
+ snippets :
7
+ - context : http
8
+ value : limit_req_zone $binary_remote_addr zone=coffeezone:10m rate=1r/s;
9
+ - context : http.server.location
10
+ value : limit_req zone=coffeezone burst=3 nodelay;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ apiVersion : gateway.networking.k8s.io/v1
2
+ kind : Gateway
3
+ metadata :
4
+ name : gateway
5
+ spec :
6
+ gatewayClassName : nginx
7
+ listeners :
8
+ - name : http
9
+ port : 80
10
+ protocol : HTTP
11
+ hostname : " *.example.com"
Original file line number Diff line number Diff line change
1
+ apiVersion : gateway.networking.k8s.io/v1
2
+ kind : HTTPRoute
3
+ metadata :
4
+ name : coffee
5
+ spec :
6
+ parentRefs :
7
+ - name : gateway
8
+ sectionName : http
9
+ hostnames :
10
+ - " cafe.example.com"
11
+ rules :
12
+ - matches :
13
+ - path :
14
+ type : PathPrefix
15
+ value : /coffee
16
+ filters :
17
+ - type : ExtensionRef
18
+ extensionRef :
19
+ group : gateway.nginx.org
20
+ kind : SnippetsFilter
21
+ name : coffee-rate-limiting-sf
22
+ backendRefs :
23
+ - name : coffee
24
+ port : 80
25
+ ---
26
+ apiVersion : gateway.networking.k8s.io/v1
27
+ kind : HTTPRoute
28
+ metadata :
29
+ name : tea
30
+ spec :
31
+ parentRefs :
32
+ - name : gateway
33
+ sectionName : http
34
+ hostnames :
35
+ - " cafe.example.com"
36
+ rules :
37
+ - matches :
38
+ - path :
39
+ type : PathPrefix
40
+ value : /tea
41
+ filters :
42
+ - type : ExtensionRef
43
+ extensionRef :
44
+ group : gateway.nginx.org
45
+ kind : SnippetsFilter
46
+ name : tea-rate-limiting-sf
47
+ backendRefs :
48
+ - name : tea
49
+ port : 80
Original file line number Diff line number Diff line change
1
+ apiVersion : gateway.nginx.org/v1alpha1
2
+ kind : SnippetsFilter
3
+ metadata :
4
+ name : tea-rate-limiting-sf
5
+ spec :
6
+ snippets :
7
+ - context : http
8
+ value : limit_req_zone $binary_remote_addr zone=teazone:10m rate=1r/s;
9
+ - context : http.server.location
10
+ value : limit_req zone=teazone burst=3;
You can’t perform that action at this time.
0 commit comments