@ingress.rule @release-1.22

Feature: host rule test

An Ingress may define routing rules based on the request path and host. 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%
Scenario: An Ingress with path rules slash and host should send traffic to the matching backend service

(path / and host diff-host-diff-path-slash matches request / and host diff-host-diff-path-slash)

check_circle
Given 20s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: diff-host-rules
spec:
rules:
- host: "diff-host-diff-path-slash"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash
port:
number: 8080

- host: "diff-host-diff-path-slash-whoami"
http:
paths:
- path: /whoami
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash-whoami
port:
number: 8080
check_circle
Then 3s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://diff-host-diff-path-slash/
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the service-diff-host-slash service
Scenario: An Ingress with path rules slash and host should send traffic to the matching backend service

(path / and host diff-host-diff-path-slash matches request /whoami and host diff-host-diff-path-slash)

check_circle
Given 10s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: diff-host-rules
spec:
rules:
- host: "diff-host-diff-path-slash"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash
port:
number: 8080

- host: "diff-host-diff-path-slash-whoami"
http:
paths:
- path: /whoami
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash-whoami
port:
number: 8080
check_circle
Then 6s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://diff-host-diff-path-slash/whoami
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the service-diff-host-slash service
Scenario: An Ingress with path rules slash and host should send traffic to the matching backend service

(path / and host diff-host-diff-path-slash matches request /whoami/a/b/c/d/e/f/g and host diff-host-diff-path-slash)

check_circle
Given 20s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: diff-host-rules
spec:
rules:
- host: "diff-host-diff-path-slash"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash
port:
number: 8080

- host: "diff-host-diff-path-slash-whoami"
http:
paths:
- path: /whoami
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash-whoami
port:
number: 8080
check_circle
Then 3s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://diff-host-diff-path-slash/whoami/a/b/c/d/e/f/g
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the service-diff-host-slash service
Scenario: An Ingress with path rules slash whoami and host should not send traffic to the matching backend service

(path /whoami and diff-host-diff-path-slash-whoami dose not matches request / and host diff-host-diff-path-slash-whoami)

check_circle
Given 10s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: diff-host-rules
spec:
rules:
- host: "diff-host-diff-path-slash"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash
port:
number: 8080

- host: "diff-host-diff-path-slash-whoami"
http:
paths:
- path: /whoami
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash-whoami
port:
number: 8080
check_circle
Then 6s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://diff-host-diff-path-slash-whoami/
check_circle
Then 0s the response status-code must be 500
Scenario: An Ingress with path rules slash whoami and host should send traffic to the matching backend service

(path /whoami and diff-host-diff-path-slash-whoami matches request /whoami and host diff-host-diff-path-slash-whoami)

check_circle
Given 15s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: diff-host-rules
spec:
rules:
- host: "diff-host-diff-path-slash"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash
port:
number: 8080

- host: "diff-host-diff-path-slash-whoami"
http:
paths:
- path: /whoami
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash-whoami
port:
number: 8080
check_circle
Then 3s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://diff-host-diff-path-slash-whoami/whoami
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the service-diff-host-slash-whoami service
Scenario: An Ingress with path rules slash whoami and host should send traffic to the matching backend service

(path /whoami and diff-host-diff-path-slash-whoami matches request /whoami/a/b/c/d/e/f/g and host diff-host-diff-path-slash-whoami)

check_circle
Given 10s an Ingress resource in a new random namespace +Show Parameter
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: diff-host-rules
spec:
rules:
- host: "diff-host-diff-path-slash"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash
port:
number: 8080

- host: "diff-host-diff-path-slash-whoami"
http:
paths:
- path: /whoami
pathType: ImplementationSpecific
backend:
service:
name: service-diff-host-slash-whoami
port:
number: 8080
check_circle
Then 6s The Ingress status shows the IP address or FQDN where it is exposed
check_circle
When 0s I send a GET request to http://diff-host-diff-path-slash-whoami/whoami/a/b/c/d/e/f/g
check_circle
Then 0s the response status-code must be 200
check_circle
And 0s the response must be served by the service-diff-host-slash-whoami service