-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dataclients/kubernetes: allow disabling catchall routes (#2656)
Catchall routes are created for Ingresses and RouteGroups that do not define predicates matching all requests for the host. Initially catchall routes were introduced by #425 for #408. Later it was discovered that multiple Ingresses for the same host may create conflicting catchall routes which was fixed by #436. Addition of RouteGroups #1180 introduced catchall routes for them as well but did not take into account that and Ingress and RouteGroup may use the same host which results in a catchall route created e.g. for RouetGroup that interferes with routes created for Ingress. The plan is to remove catchall route logic because it simply shunts the request and responds with the default response status which matches the behaviour when Skipper can not look up route at all. This change introduces a flag to disable creation of catchall routes. Updates #408 Updates #2394 Signed-off-by: Alexander Yastrebov <[email protected]>
- Loading branch information
1 parent
26018f6
commit 40f4634
Showing
13 changed files
with
146 additions
and
18 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
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
9 changes: 9 additions & 0 deletions
9
dataclients/kubernetes/testdata/ingressV1/ingress-data/disabled-catchall.eskip
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,9 @@ | ||
kube_namespace1__ingress1__test_example_org___test1__service1: | ||
Host(/^(test[.]example[.]org[.]?(:[0-9]+)?)$/) | ||
&& PathRegexp(/^(\/test1)/) | ||
-> "http://42.0.1.2:8080"; | ||
|
||
kube_namespace1__ingress1__test_ingress_cluster_local___test1__service1: | ||
Host("^(test[.]ingress[.]cluster[.]local[.]?(:[0-9]+)?)$") | ||
&& PathRegexp("^(/test1)") | ||
-> "http://42.0.1.2:8080"; |
3 changes: 3 additions & 0 deletions
3
dataclients/kubernetes/testdata/ingressV1/ingress-data/disabled-catchall.kube
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,3 @@ | ||
disableCatchAllRoutes: true | ||
eastWestRangeDomains: | ||
- ingress.cluster.local |
53 changes: 53 additions & 0 deletions
53
dataclients/kubernetes/testdata/ingressV1/ingress-data/disabled-catchall.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: | ||
namespace: namespace1 | ||
name: ingress1 | ||
spec: | ||
rules: | ||
- host: test.example.org | ||
http: | ||
paths: | ||
- path: "/test1" | ||
pathType: ImplementationSpecific | ||
backend: | ||
service: | ||
name: service1 | ||
port: | ||
name: port1 | ||
- host: test.ingress.cluster.local | ||
http: | ||
paths: | ||
- path: "/test1" | ||
pathType: ImplementationSpecific | ||
backend: | ||
service: | ||
name: service1 | ||
port: | ||
name: port1 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
namespace: namespace1 | ||
name: service1 | ||
spec: | ||
clusterIP: 1.2.3.4 | ||
ports: | ||
- name: port1 | ||
port: 8080 | ||
targetPort: 8080 | ||
type: ClusterIP | ||
--- | ||
apiVersion: v1 | ||
kind: Endpoints | ||
metadata: | ||
namespace: namespace1 | ||
name: service1 | ||
subsets: | ||
- addresses: | ||
- ip: 42.0.1.2 | ||
ports: | ||
- name: port1 | ||
port: 8080 | ||
protocol: TCP |
2 changes: 2 additions & 0 deletions
2
dataclients/kubernetes/testdata/routegroups/convert/disabled-catchall.eskip
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,2 @@ | ||
kube_rg__default__myapp__all__0_0: Host("^(example[.]org[.]?(:[0-9]+)?)$") && Path("/app") -> "http://10.2.4.8:80"; | ||
kube_rg__internal_default__myapp__all__0_0: Host("^(example[.]ingress[.]cluster[.]local[.]?(:[0-9]+)?)$") && Path("/app") -> "http://10.2.4.8:80"; |
3 changes: 3 additions & 0 deletions
3
dataclients/kubernetes/testdata/routegroups/convert/disabled-catchall.kube
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,3 @@ | ||
disableCatchAllRoutes: true | ||
eastWestRangeDomains: | ||
- ingress.cluster.local |
40 changes: 40 additions & 0 deletions
40
dataclients/kubernetes/testdata/routegroups/convert/disabled-catchall.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,40 @@ | ||
apiVersion: zalando.org/v1 | ||
kind: RouteGroup | ||
metadata: | ||
name: myapp | ||
spec: | ||
hosts: | ||
- example.org | ||
- example.ingress.cluster.local | ||
backends: | ||
- name: myapp | ||
type: service | ||
serviceName: myapp | ||
servicePort: 80 | ||
defaultBackends: | ||
- backendName: myapp | ||
routes: | ||
- path: /app | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: myapp | ||
spec: | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 80 | ||
selector: | ||
application: myapp | ||
type: ClusterIP | ||
--- | ||
apiVersion: v1 | ||
kind: Endpoints | ||
metadata: | ||
name: myapp | ||
subsets: | ||
- addresses: | ||
- ip: 10.2.4.8 | ||
ports: | ||
- port: 80 |
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