From aea8b5ae0d7f8be031022a6a7931fdf3796d96ef Mon Sep 17 00:00:00 2001 From: aamingaa <774066625@qq.com> Date: Fri, 24 Mar 2023 19:56:07 +0800 Subject: [PATCH 1/4] feat: change --- .../src/main/resources/k8s/Deployment.yml | 4 +- .../src/main/resources/k8s/Deployment.yml | 16 ++--- .../main/resources/k8s/Virtual-Service.yml | 60 +++++++++++++++++++ 3 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Virtual-Service.yml 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/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..2e8944249f 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 @@ -19,7 +19,7 @@ metadata: name: dubbo-samples-xds-provider namespace: dubbo-demo spec: - replicas: 3 + replicas: 1 selector: matchLabels: app: dubbo-samples-xds-provider @@ -30,13 +30,13 @@ spec: spec: containers: - name: server - image: apache/dubbo-demo:dubbo-samples-xds-provider_0.0.1 - livenessProbe: - httpGet: - path: /live - port: 22222 - initialDelaySeconds: 5 - periodSeconds: 5 + 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 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..633cd2635f --- /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: 80 + - 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: 20 + +--- +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + name: dubbo-samples-xds-provider + namespace: dubbo-demo +spec: + host: dubbo-samples-mesh-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 From b77cb2e743aabfac41bcd2a74e41a83b57a4228d Mon Sep 17 00:00:00 2001 From: aamingaa <774066625@qq.com> Date: Sat, 25 Mar 2023 11:05:30 +0800 Subject: [PATCH 2/4] feat: change ds --- .../src/main/resources/k8s/Deployment.yml | 2 +- .../src/main/resources/k8s/Virtual-Service.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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 2e8944249f..80c080eafb 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 @@ -19,7 +19,7 @@ metadata: name: dubbo-samples-xds-provider namespace: dubbo-demo spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: dubbo-samples-xds-provider 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 index 633cd2635f..576bc8ccc3 100644 --- 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 @@ -30,14 +30,14 @@ spec: 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: 80 + weight: 100 - 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: 20 + weight: 0 --- apiVersion: networking.istio.io/v1alpha3 @@ -46,7 +46,7 @@ metadata: name: dubbo-samples-xds-provider namespace: dubbo-demo spec: - host: dubbo-samples-mesh-provider.dubbo-demo.svc.cluster.local + host: dubbo-samples-xds-provider.dubbo-demo.svc.cluster.local trafficPolicy: loadBalancer: # Envoy load balancing strategy From 9418d9b30c8b86e9536353063e97f698dde7f620 Mon Sep 17 00:00:00 2001 From: aamingaa <774066625@qq.com> Date: Sat, 25 Mar 2023 15:21:14 +0800 Subject: [PATCH 3/4] feat: change dubbo version --- .../dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml | 2 +- .../dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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..2fe7495d71 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 + 3.2.0-beta.7-SNAPSHOT 4.3.29.RELEASE 4.13.1 3.7.0 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..54e1668bd0 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 + 3.2.0-beta.7-SNAPSHOT 4.3.29.RELEASE 4.13.1 3.7.0 From e09449886a2e896d0649f85ecbe021ced69c50c6 Mon Sep 17 00:00:00 2001 From: aamingaa <774066625@qq.com> Date: Tue, 28 Mar 2023 10:34:54 +0800 Subject: [PATCH 4/4] feat: change --- .../dubbo-samples-xds-consumer/pom.xml | 2 +- .../dubbo-samples-xds-provider/pom.xml | 2 +- .../src/main/resources/k8s/Deployment-2.yml | 53 +++++++++++++++++++ .../src/main/resources/k8s/Deployment.yml | 18 ++++--- .../main/resources/k8s/Virtual-Service.yml | 4 +- 5 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment-2.yml 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 2fe7495d71..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.2.0-beta.7-SNAPSHOT + 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/pom.xml b/3-extensions/registry/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml index 54e1668bd0..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.2.0-beta.7-SNAPSHOT + 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 80c080eafb..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,27 +16,29 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: dubbo-samples-xds-provider + name: dubbo-samples-xds-provider-v1 namespace: dubbo-demo spec: - replicas: 2 + 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: aamingaa/dubbo-demo:dubbo-samples-xds-provider_0.0.1 -# livenessProbe: -# httpGet: -# path: /live -# port: 22222 -# initialDelaySeconds: 5 -# periodSeconds: 5 + livenessProbe: + httpGet: + path: /live + port: 22222 + initialDelaySeconds: 5 + periodSeconds: 5 readinessProbe: httpGet: path: /ready 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 index 576bc8ccc3..81dbcac168 100644 --- 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 @@ -30,14 +30,14 @@ spec: 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: 100 + 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: 0 + weight: 10 --- apiVersion: networking.istio.io/v1alpha3