-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for upstreams options in VS/VSR
- Loading branch information
Showing
17 changed files
with
851 additions
and
161 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
9 changes: 9 additions & 0 deletions
9
tests/data/virtual-server-route-upstream-options/configmap-with-keys.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,9 @@ | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: nginx-config | ||
namespace: nginx-ingress | ||
data: | ||
lb-method: "round_robin" | ||
max-fails: "3" | ||
fail-timeout: "33s" |
24 changes: 24 additions & 0 deletions
24
tests/data/virtual-server-route-upstream-options/route-multiple-invalid-keys.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,24 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServerRoute | ||
metadata: | ||
name: backends | ||
spec: | ||
host: virtual-server-route.example.com | ||
upstreams: | ||
- name: backend1 | ||
service: backend1-svc | ||
port: 80 | ||
lb-method: "} exit;" | ||
max-fails: -10 | ||
fail-timeout: "20 seconds" | ||
- name: backend3 | ||
service: backend3-svc | ||
port: 80 | ||
lb-method: "123" | ||
max-fails: -10 | ||
fail-timeout: "s" | ||
subroutes: | ||
- path: "/backends/backend1" | ||
upstream: backend1 | ||
- path: "/backends/backend3" | ||
upstream: backend3 |
18 changes: 18 additions & 0 deletions
18
tests/data/virtual-server-route-upstream-options/route-multiple.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,18 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServerRoute | ||
metadata: | ||
name: backends | ||
spec: | ||
host: virtual-server-route.example.com | ||
upstreams: | ||
- name: backend1 | ||
service: backend1-svc | ||
port: 80 | ||
- name: backend3 | ||
service: backend3-svc | ||
port: 80 | ||
subroutes: | ||
- path: "/backends/backend1" | ||
upstream: backend1 | ||
- path: "/backends/backend3" | ||
upstream: backend3 |
16 changes: 16 additions & 0 deletions
16
tests/data/virtual-server-route-upstream-options/route-single-invalid-keys.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,16 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServerRoute | ||
metadata: | ||
name: backend2 | ||
spec: | ||
host: virtual-server-route.example.com | ||
upstreams: | ||
- name: backend2 | ||
service: backend2-svc | ||
port: 80 | ||
lb-method: "random two least_connn" | ||
max-fails: -10 | ||
fail-timeout: "20 seconds" | ||
subroutes: | ||
- path: "/backend2" | ||
upstream: backend2 |
13 changes: 13 additions & 0 deletions
13
tests/data/virtual-server-route-upstream-options/route-single.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,13 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServerRoute | ||
metadata: | ||
name: backend2 | ||
spec: | ||
host: virtual-server-route.example.com | ||
upstreams: | ||
- name: backend2 | ||
service: backend2-svc | ||
port: 80 | ||
subroutes: | ||
- path: "/backend2" | ||
upstream: backend2 |
11 changes: 11 additions & 0 deletions
11
tests/data/virtual-server-route-upstream-options/standard/virtual-server.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,11 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServer | ||
metadata: | ||
name: virtual-server-route | ||
spec: | ||
host: virtual-server-route.example.com | ||
routes: | ||
- path: "/backends" | ||
route: backends-namespace/backends | ||
- path: "/backend2" | ||
route: backend2-namespace/backend2 |
9 changes: 9 additions & 0 deletions
9
tests/data/virtual-server-upstream-options/configmap-with-keys.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,9 @@ | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: nginx-config | ||
namespace: nginx-ingress | ||
data: | ||
lb-method: "round_robin" | ||
max-fails: "3" | ||
fail-timeout: "33s" |
18 changes: 18 additions & 0 deletions
18
tests/data/virtual-server-upstream-options/standard/virtual-server.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,18 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServer | ||
metadata: | ||
name: virtual-server | ||
spec: | ||
host: virtual-server.example.com | ||
upstreams: | ||
- name: backend2 | ||
service: backend2-svc | ||
port: 80 | ||
- name: backend1 | ||
service: backend1-svc | ||
port: 80 | ||
routes: | ||
- path: "/backend1" | ||
upstream: backend1 | ||
- path: "/backend2" | ||
upstream: backend2 |
24 changes: 24 additions & 0 deletions
24
tests/data/virtual-server-upstream-options/virtual-server-with-invalid-keys.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,24 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServer | ||
metadata: | ||
name: virtual-server | ||
spec: | ||
host: virtual-server.example.com | ||
upstreams: | ||
- name: backend2 | ||
service: backend2-svc | ||
port: 80 | ||
lb-method: "} exit;" | ||
max-fails: -10 | ||
fail-timeout: "20 seconds" | ||
- name: backend1 | ||
service: backend1-svc | ||
port: 80 | ||
lb-method: "123" | ||
max-fails: -10 | ||
fail-timeout: "s" | ||
routes: | ||
- path: "/backend1" | ||
upstream: backend1 | ||
- path: "/backend2" | ||
upstream: backend2 |
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.