-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply configuration of SnippetsFilters to NGINX (#2604)
Problem: As a user of NGF, I want my SnippetsFilters configuration applied to NGF's data plane, so that I can leverage NGINX features not yet available in NGF. Solution: Apply configuration of valid SnippetsFilters referenced in HTTPRoutes and GRPCRoutes to the appropriate contexts in the NGINX config. If the SnippetsFilter referenced is invalid (wrong group or kind), the routing rule is not configured. If the SnippetsFilter cannot be resolved, the routing rule is configured, but the route will return a 500.
- Loading branch information
1 parent
95f642e
commit 4626043
Showing
44 changed files
with
4,616 additions
and
1,318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: coffee | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: coffee | ||
template: | ||
metadata: | ||
labels: | ||
app: coffee | ||
spec: | ||
containers: | ||
- name: coffee | ||
image: nginxdemos/nginx-hello:plain-text | ||
ports: | ||
- containerPort: 8080 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: coffee | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: coffee | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: gateway | ||
spec: | ||
gatewayClassName: nginx | ||
listeners: | ||
- name: http | ||
port: 80 | ||
protocol: HTTP | ||
hostname: "*.example.com" | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: coffee | ||
spec: | ||
parentRefs: | ||
- name: gateway | ||
sectionName: http | ||
hostnames: | ||
- "cafe.example.com" | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: /coffee | ||
filters: | ||
- type: ExtensionRef | ||
extensionRef: | ||
group: gateway.nginx.org | ||
kind: SnippetsFilter | ||
name: test-all-contexts | ||
backendRefs: | ||
- name: coffee | ||
port: 80 | ||
--- | ||
apiVersion: gateway.nginx.org/v1alpha1 | ||
kind: SnippetsFilter | ||
metadata: | ||
name: test-all-contexts | ||
spec: | ||
snippets: | ||
- context: main | ||
value: worker_shutdown_timeout 120s; | ||
- context: http | ||
value: aio on; | ||
- context: http.server | ||
value: auth_delay 10s; | ||
- context: http.server.location | ||
value: | | ||
allow 10.0.0.0/8; | ||
deny all; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.