@sig-network @conformance @release-1.19

Feature: Path rules

An Ingress may define routing rules based on the request path. If the HTTP request path matches one of the paths in the Ingress objects, the traffic is routed to its backend service.

Scenarios
Status Progress

Passed

100.00%

Failed

0.00%
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-path-rules/foo
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the foo-exact service
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-path-rules/foo/
check_circle
Then 0s the response status-code must be 404
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-path-rules/FOO
check_circle
Then 0s the response status-code must be 404
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://exact-path-rules/bar
check_circle
Then 0s the response status-code must be 404
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://prefix-path-rules/foo
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the foo-prefix service
check_circle
Given 35s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 5s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://prefix-path-rules/foo/
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the foo-prefix service
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://prefix-path-rules/FOO
check_circle
Then 0s the response status-code must be 404
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 5s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://prefix-path-rules/aaa/bbb
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the aaa-slash-bbb-prefix service
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://prefix-path-rules/aaa/bbb/ccc
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the aaa-slash-bbb-prefix service
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://prefix-path-rules/aaa/ccc
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the aaa-prefix service
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://prefix-path-rules/aaaccc
check_circle
Then 0s the response status-code must be 404
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://prefix-path-rules/foo/
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the foo-prefix service
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://mixed-path-rules/foo
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the foo-exact service
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://trailing-slash-path-rules/aaa/bbb
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the aaa-slash-bbb-slash-prefix service
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://trailing-slash-path-rules/aaa/bbb/
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the aaa-slash-bbb-slash-prefix service
check_circle
Given 30s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: path-rules
spec:
rules:
- host: "exact-path-rules"
http:
paths:
- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "prefix-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /aaa/bbb
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-prefix
port:
number: 8080

- path: /aaa
pathType: Prefix
backend:
service:
name: aaa-prefix
port:
number: 8080

- host: "mixed-path-rules"
http:
paths:
- path: /foo
pathType: Prefix
backend:
service:
name: foo-prefix
port:
number: 8080

- path: /foo
pathType: Exact
backend:
service:
name: foo-exact
port:
number: 8080

- host: "trailing-slash-path-rules"
http:
paths:
- path: /aaa/bbb/
pathType: Prefix
backend:
service:
name: aaa-slash-bbb-slash-prefix
port:
number: 8080

- path: /foo/
pathType: Exact
backend:
service:
name: foo-slash-exact
port:
number: 8080
check_circle
Then 10s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://trailing-slash-path-rules/foo
check_circle
Then 0s the response status-code must be 404