forked from dotnet/yarp
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add yarp.ingress.kubernetes.io/route-queryparameters to allow ingress…
… forking based on query parameters (dotnet#2436) * Add QueryParameters routing for Kubernetes.Ingress * Update documentation to be plural * retrigger checks * Fix validation file * Update docs --------- Co-authored-by: Jeff Sedlak <jsedlak@gmail.com> Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
- Loading branch information
1 parent
e678db4
commit 1483fb7
Showing
7 changed files
with
163 additions
and
4 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
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
18 changes: 18 additions & 0 deletions
18
test/Kubernetes.Tests/testassets/route-queryparameters/clusters.json
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,18 @@ | ||
[ | ||
{ | ||
"ClusterId": "frontend.default:80", | ||
"LoadBalancingPolicy": null, | ||
"SessionAffinity": null, | ||
"HealthCheck": null, | ||
"HttpClient": null, | ||
"HttpRequest": null, | ||
"Destinations": { | ||
"http://10.244.2.38:80": { | ||
"Address": "http://10.244.2.38:80", | ||
"Health": null, | ||
"Metadata": null | ||
} | ||
}, | ||
"Metadata": null | ||
} | ||
] |
53 changes: 53 additions & 0 deletions
53
test/Kubernetes.Tests/testassets/route-queryparameters/ingress.yaml
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,53 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: minimal-ingress | ||
namespace: default | ||
annotations: | ||
yarp.ingress.kubernetes.io/route-metadata: | | ||
foo: bar | ||
another-key: another-value | ||
yarp.ingress.kubernetes.io/route-queryparameters: | | ||
- Name: the-queryparameter-key | ||
Values: | ||
- the-queryparameter-value | ||
Mode: Contains | ||
IsCaseSensitive: false | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /foo | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: frontend | ||
port: | ||
number: 80 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: frontend | ||
namespace: default | ||
spec: | ||
selector: | ||
app: frontend | ||
ports: | ||
- name: https | ||
port: 80 | ||
targetPort: 80 | ||
type: ClusterIP | ||
--- | ||
apiVersion: v1 | ||
kind: Endpoints | ||
metadata: | ||
name: frontend | ||
namespace: default | ||
subsets: | ||
- addresses: | ||
- ip: 10.244.2.38 | ||
ports: | ||
- name: https | ||
port: 80 | ||
protocol: TCP |
29 changes: 29 additions & 0 deletions
29
test/Kubernetes.Tests/testassets/route-queryparameters/routes.json
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,29 @@ | ||
[ | ||
{ | ||
"RouteId": "minimal-ingress.default:/foo", | ||
"Match": { | ||
"Methods": null, | ||
"Hosts": [], | ||
"Path": "/foo/{**catch-all}", | ||
"Headers": null, | ||
"QueryParameters": [ | ||
{ | ||
"Name": "the-queryparameter-key", | ||
"Values": [ "the-queryparameter-value" ], | ||
"Mode": "Contains", | ||
"IsCaseSensitive": false | ||
} | ||
] | ||
}, | ||
"Order": null, | ||
"ClusterId": "frontend.default:80", | ||
"AuthorizationPolicy": null, | ||
"RateLimiterPolicy": null, | ||
"CorsPolicy": null, | ||
"Metadata": { | ||
"foo": "bar", | ||
"another-key": "another-value" | ||
}, | ||
"Transforms": null | ||
} | ||
] |