-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functional tests for UpstreamSettings Policy (#2869)
Functional Tests for UpstreamSettings Policy.
- Loading branch information
1 parent
939aee6
commit b0ed7e2
Showing
12 changed files
with
943 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: coffee | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: coffee | ||
template: | ||
metadata: | ||
labels: | ||
app: coffee | ||
spec: | ||
containers: | ||
- name: coffee | ||
image: nginxdemos/nginx-hello:plain-text | ||
ports: | ||
- containerPort: 8080 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: coffee | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: coffee | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tea | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: tea | ||
template: | ||
metadata: | ||
labels: | ||
app: tea | ||
spec: | ||
containers: | ||
- name: tea | ||
image: nginxdemos/nginx-hello:plain-text | ||
ports: | ||
- containerPort: 8080 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: tea | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: tea | ||
--- |
11 changes: 11 additions & 0 deletions
11
tests/suite/manifests/upstream-settings-policy/gateway.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: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: gateway | ||
spec: | ||
gatewayClassName: nginx | ||
listeners: | ||
- name: http | ||
port: 80 | ||
protocol: HTTP | ||
hostname: "*.example.com" |
39 changes: 39 additions & 0 deletions
39
tests/suite/manifests/upstream-settings-policy/grpc-backend.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,39 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: grpc-backend | ||
spec: | ||
selector: | ||
app: grpc-backend | ||
ports: | ||
- protocol: TCP | ||
port: 8080 | ||
targetPort: 50051 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: grpc-backend | ||
labels: | ||
app: grpc-backend | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: grpc-backend | ||
template: | ||
metadata: | ||
labels: | ||
app: grpc-backend | ||
spec: | ||
containers: | ||
- name: grpc-backend | ||
image: ghcr.io/nginxinc/kic-test-grpc-server:0.2.3 | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
resources: | ||
requests: | ||
cpu: 10m |
15 changes: 15 additions & 0 deletions
15
tests/suite/manifests/upstream-settings-policy/invalid-svc-usps.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,15 @@ | ||
apiVersion: gateway.nginx.org/v1alpha1 | ||
kind: UpstreamSettingsPolicy | ||
metadata: | ||
name: usps-target-not-found | ||
spec: | ||
zoneSize: 512k | ||
targetRefs: | ||
- group: core | ||
kind: Service | ||
name: targeted-svc-dne | ||
keepAlive: | ||
connections: 10 | ||
requests: 3 | ||
time: 10s | ||
timeout: 50s |
81 changes: 81 additions & 0 deletions
81
tests/suite/manifests/upstream-settings-policy/invalid-target-usps.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,81 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: gateway-not-valid | ||
spec: | ||
gatewayClassName: nginx | ||
addresses: | ||
- value: "10.0.0.1" | ||
listeners: | ||
- name: http | ||
port: 80 | ||
protocol: HTTP | ||
hostname: "soda.example.com" | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: soda | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: soda | ||
template: | ||
metadata: | ||
labels: | ||
app: soda | ||
spec: | ||
containers: | ||
- name: soda | ||
image: nginxdemos/nginx-hello:plain-text | ||
ports: | ||
- containerPort: 8080 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: soda | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: soda | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: soda | ||
spec: | ||
parentRefs: | ||
- name: gateway-not-valid | ||
sectionName: http | ||
hostnames: | ||
- "soda.example.com" | ||
rules: | ||
- matches: | ||
- path: | ||
type: Exact | ||
value: /soda | ||
backendRefs: | ||
- name: soda | ||
port: 80 | ||
--- | ||
apiVersion: gateway.nginx.org/v1alpha1 | ||
kind: UpstreamSettingsPolicy | ||
metadata: | ||
name: soda-svc-usp | ||
spec: | ||
zoneSize: 512k | ||
targetRefs: | ||
- group: core | ||
kind: Service | ||
name: soda | ||
keepAlive: | ||
connections: 10 | ||
requests: 3 | ||
time: 10s | ||
timeout: 50s |
Oops, something went wrong.