-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xDS router and lb integration test: demo and test case
Signed-off-by: daizhenyu <[email protected]>
- Loading branch information
Showing
23 changed files
with
999 additions
and
2 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
sermant-integration-tests/xds-service-test/config/plugins.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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
plugins: | ||
- xds-service-discovery | ||
- xds-service-discovery | ||
- service-router |
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
7 changes: 7 additions & 0 deletions
7
sermant-integration-tests/xds-service-test/product/spring-cloud-client/Dockerfile
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,7 @@ | ||
FROM openjdk:8 | ||
WORKDIR /home | ||
COPY agent/ /home/agent | ||
COPY spring-cloud-client.jar /home/spring-cloud-client.jar | ||
COPY start.sh /home | ||
RUN chmod -R 777 /home | ||
ENTRYPOINT ["sh", "/home/start.sh"] |
1 change: 1 addition & 0 deletions
1
sermant-integration-tests/xds-service-test/product/spring-cloud-client/start.sh
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 @@ | ||
exec java -jar /home/spring-cloud-client.jar |
47 changes: 47 additions & 0 deletions
47
...ion-tests/xds-service-test/script/router/deployment/spring-client-sermant-xds-router.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,47 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: spring-client | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: spring-client | ||
template: | ||
metadata: | ||
labels: | ||
app: spring-client | ||
spec: | ||
containers: | ||
- name: spring-client | ||
image: spring-client:1.0.0 | ||
imagePullPolicy: Never | ||
ports: | ||
- containerPort: 8080 | ||
env: | ||
- name: agent_service_dynamic_config_enable | ||
value: "false" | ||
- name: agent_service_xds_service_enable | ||
value: "true" | ||
- name: router_plugin_enabled_xds_route | ||
value: "true" | ||
- name: xds_service_discovery_enabled | ||
value: "false" | ||
- name: JAVA_TOOL_OPTIONS | ||
value: "-javaagent:/home/agent/sermant-agent.jar" | ||
imagePullSecrets: | ||
- name: default-secret | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: spring-client | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 8080 | ||
targetPort: 8080 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: spring-client |
47 changes: 47 additions & 0 deletions
47
...sts/xds-service-test/script/router/deployment/spring-cloud-client-sermant-xds-router.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,47 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: spring-cloud-client | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: spring-cloud-client | ||
template: | ||
metadata: | ||
labels: | ||
app: spring-cloud-client | ||
spec: | ||
containers: | ||
- name: spring-cloud-client | ||
image: spring-cloud-client:1.0.0 | ||
imagePullPolicy: Never | ||
ports: | ||
- containerPort: 8082 | ||
env: | ||
- name: agent_service_dynamic_config_enable | ||
value: "false" | ||
- name: agent_service_xds_service_enable | ||
value: "true" | ||
- name: router_plugin_enabled-xds-route | ||
value: "true" | ||
- name: ZOOKEEPER_IP | ||
value: "zookeeper.default.svc.cluster.local" | ||
- name: JAVA_TOOL_OPTIONS | ||
value: "-javaagent:/home/agent/sermant-agent.jar" | ||
imagePullSecrets: | ||
- name: default-secret | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: spring-cloud-client | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 8082 | ||
targetPort: 8082 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: spring-cloud-client |
77 changes: 77 additions & 0 deletions
77
sermant-integration-tests/xds-service-test/script/router/deployment/spring-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,77 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: spring-server-v1 | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: spring-server | ||
version: v1 | ||
template: | ||
metadata: | ||
labels: | ||
app: spring-server | ||
version: v1 | ||
spec: | ||
containers: | ||
- name: spring-server | ||
image: spring-server:1.0.0 | ||
imagePullPolicy: Never | ||
ports: | ||
- containerPort: 8081 | ||
env: | ||
- name: SERVER_VERSION | ||
value: "v1" | ||
- name: ZOOKEEPER_IP | ||
value: "zookeeper.default.svc.cluster.local" | ||
- name: ZOOKEEPER_ENABLED | ||
value: "true" | ||
imagePullSecrets: | ||
- name: default-secret | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: spring-server-v2 | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: spring-server | ||
version: v2 | ||
template: | ||
metadata: | ||
labels: | ||
app: spring-server | ||
version: v2 | ||
spec: | ||
containers: | ||
- name: spring-server | ||
image: spring-server:1.0.0 | ||
imagePullPolicy: Never | ||
ports: | ||
- containerPort: 8081 | ||
env: | ||
- name: SERVER_VERSION | ||
value: "v2" | ||
- name: ZOOKEEPER_IP | ||
value: "zookeeper.default.svc.cluster.local" | ||
- name: ZOOKEEPER_ENABLED | ||
value: "true" | ||
imagePullSecrets: | ||
- name: default-secret | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: spring-server | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 8081 | ||
targetPort: 8081 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: spring-server |
16 changes: 16 additions & 0 deletions
16
...on-tests/xds-service-test/script/router/router-rule/spring-server-destination-random.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: networking.istio.io/v1alpha3 | ||
kind: DestinationRule | ||
metadata: | ||
name: spring-server-destinationrule-random | ||
spec: | ||
host: spring-server.default.svc.cluster.local | ||
trafficPolicy: | ||
loadBalancer: | ||
simple: RANDOM | ||
subsets: | ||
- name: v1 | ||
labels: | ||
version: v1 | ||
- name: v2 | ||
labels: | ||
version: v2 |
16 changes: 16 additions & 0 deletions
16
...ion-tests/xds-service-test/script/router/router-rule/spring-server-destination-robin.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: networking.istio.io/v1alpha3 | ||
kind: DestinationRule | ||
metadata: | ||
name: spring-server-destinationrule-robin | ||
spec: | ||
host: spring-server.default.svc.cluster.local | ||
trafficPolicy: | ||
loadBalancer: | ||
simple: ROUND_ROBIN | ||
subsets: | ||
- name: v1 | ||
labels: | ||
version: v1 | ||
- name: v2 | ||
labels: | ||
version: v2 |
56 changes: 56 additions & 0 deletions
56
...ration-tests/xds-service-test/script/router/router-rule/spring-server-virtureservice.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,56 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: spring-server-virtualservice | ||
spec: | ||
hosts: | ||
- spring-server | ||
http: | ||
- name: "v1-routes" | ||
match: | ||
- headers: | ||
version: | ||
exact: v1 | ||
uri: | ||
exact: /router | ||
ignoreUriCase: false | ||
route: | ||
- destination: | ||
host: spring-server | ||
subset: v1 | ||
port: | ||
number: 8081 | ||
- name: "v2-routes" | ||
match: | ||
- headers: | ||
version: | ||
exact: v2 | ||
uri: | ||
prefix: / | ||
ignoreUriCase: false | ||
route: | ||
- destination: | ||
host: spring-server | ||
port: | ||
number: 8081 | ||
- name: "base-route" | ||
match: | ||
- headers: | ||
version: | ||
exact: base | ||
uri: | ||
exact: /router | ||
ignoreUriCase: false | ||
route: | ||
- destination: | ||
host: spring-server | ||
subset: v1 | ||
port: | ||
number: 8081 | ||
weight: 0 | ||
- destination: | ||
host: spring-server | ||
subset: v2 | ||
port: | ||
number: 8081 | ||
weight: 100 |
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.