diff --git a/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml index b78c25538a..e45bd20745 100644 --- a/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml +++ b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml @@ -31,7 +31,7 @@ 1.8 1.8 - 3.1.0 + 4.0 4.3.29.RELEASE 4.13.1 3.7.0 diff --git a/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml index 49f51c68bc..415319ae71 100644 --- a/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml +++ b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml @@ -19,7 +19,7 @@ metadata: name: dubbo-samples-xds-consumer namespace: dubbo-demo spec: - replicas: 2 + replicas: 1 selector: matchLabels: app: dubbo-samples-xds-consumer @@ -30,7 +30,7 @@ spec: spec: containers: - name: server - image: apache/dubbo-demo:dubbo-samples-xds-consumer_0.0.1 + image: aamingaa/dubbo-demo:dubbo-samples-xds-consumer_0.0.1 livenessProbe: httpGet: path: /live diff --git a/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml index 24680bb71a..ec34a06106 100644 --- a/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml +++ b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml @@ -31,7 +31,7 @@ 1.8 1.8 - 3.1.0 + 4.0 4.3.29.RELEASE 4.13.1 3.7.0 diff --git a/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment-2.yml b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment-2.yml new file mode 100644 index 0000000000..7bd7210145 --- /dev/null +++ b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment-2.yml @@ -0,0 +1,53 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dubbo-samples-xds-provider-v2 + namespace: dubbo-demo +spec: + replicas: 1 + selector: + matchLabels: + app: dubbo-samples-xds-provider + version: v2 + template: + metadata: + labels: + app: dubbo-samples-xds-provider + version: v2 + spec: + containers: + - name: server + image: aamingaa/dubbo-demo:dubbo-samples-xds-provider_0.0.1 + livenessProbe: + httpGet: + path: /live + port: 22222 + initialDelaySeconds: 5 + periodSeconds: 5 + readinessProbe: + httpGet: + path: /ready + port: 22222 + initialDelaySeconds: 5 + periodSeconds: 5 + startupProbe: + httpGet: + path: /startup + port: 22222 + failureThreshold: 30 + periodSeconds: 10 \ No newline at end of file diff --git a/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml index 941307c0db..125713904d 100644 --- a/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml +++ b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml @@ -16,21 +16,23 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: dubbo-samples-xds-provider + name: dubbo-samples-xds-provider-v1 namespace: dubbo-demo spec: - replicas: 3 + replicas: 1 selector: matchLabels: app: dubbo-samples-xds-provider + version: v1 template: metadata: labels: app: dubbo-samples-xds-provider + version: v1 spec: containers: - name: server - image: apache/dubbo-demo:dubbo-samples-xds-provider_0.0.1 + image: aamingaa/dubbo-demo:dubbo-samples-xds-provider_0.0.1 livenessProbe: httpGet: path: /live diff --git a/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Virtual-Service.yml b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Virtual-Service.yml new file mode 100644 index 0000000000..81dbcac168 --- /dev/null +++ b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Virtual-Service.yml @@ -0,0 +1,60 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: dubbo-samples-xds-provider + namespace: dubbo-demo +spec: + hosts: + - dubbo-samples-xds-provider.dubbo-demo.svc.cluster.local + http: + - route: + - destination: + host: dubbo-samples-xds-provider.dubbo-demo.svc.cluster.local + subset: v1 + port: + # Specifies the port on the host being addressed. If the service exposes only one port, you don't need to choose the port explicitly + number: 50051 + weight: 90 + - destination: + host: dubbo-samples-xds-provider.dubbo-demo.svc.cluster.local + subset: v2 + port: + # Specifies the port on the host being addressed. If the service exposes only one port, you don't need to choose the port explicitly + number: 50051 + weight: 10 + +--- +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + name: dubbo-samples-xds-provider + namespace: dubbo-demo +spec: + host: dubbo-samples-xds-provider.dubbo-demo.svc.cluster.local + trafficPolicy: + loadBalancer: + # Envoy load balancing strategy + simple: ROUND_ROBIN + subsets: + - name: v1 + labels: + version: v1 + - name: v2 + labels: + version: v2 \ No newline at end of file