From 6bc432fb72804f7ef3147660f306e4b0a0b0f0a5 Mon Sep 17 00:00:00 2001 From: chenyanlann <32511cyl@gmail.com> Date: Thu, 3 Nov 2022 23:21:35 +0800 Subject: [PATCH 1/5] add agent mode --- dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml | 2 +- .../src/main/resources/k8s/Deployment.yml | 3 +++ .../src/main/resources/spring/dubbo-consumer.properties | 1 + dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml | 2 +- .../src/main/resources/k8s/Deployment.yml | 3 +++ .../src/main/resources/spring/dubbo-provider.properties | 1 + 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml b/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml index 54ac25c490..3421c2e6ff 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml +++ b/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml @@ -31,7 +31,7 @@ 1.8 1.8 - 3.1.0-SNAPSHOT + 3.1.2-SNAPSHOT 4.3.16.RELEASE 4.12 3.7.0 diff --git a/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml b/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml index 859acd69d6..04c9bc53ad 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml +++ b/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml @@ -12,6 +12,9 @@ spec: metadata: labels: app: dubbo-samples-xds-consumer +# annotations: +# inject.istio.io/templates: grpc-agent +# proxy.istio.io/config: '{"holdApplicationUntilProxyStarts": true}' spec: containers: - name: server diff --git a/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties b/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties index e866c68df9..f8c359240c 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties +++ b/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties @@ -19,6 +19,7 @@ dubbo.application.name=dubbo-samples-xds-consumer dubbo.application.metadataServicePort=20885 dubbo.registry.address=xds://istiod.istio-system.svc:15012 +#dubbo.registry.address=xds://istiod.istio-system.svc:15012?use-agent=true dubbo.consumer.timeout=3000 dubbo.consumer.check=false dubbo.application.qosEnable=true diff --git a/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml b/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml index 6d8ff9eb35..c07a6f5b22 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml +++ b/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml @@ -31,7 +31,7 @@ 1.8 1.8 - 3.1.0-SNAPSHOT + 3.1.2-SNAPSHOT 4.3.16.RELEASE 4.12 3.7.0 diff --git a/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml b/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml index 4aa005afe0..1b8cdf1e22 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml +++ b/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml @@ -12,6 +12,9 @@ spec: metadata: labels: app: dubbo-samples-xds-provider +# annotations: +# inject.istio.io/templates: grpc-agent +# proxy.istio.io/config: '{"holdApplicationUntilProxyStarts": true}' spec: containers: - name: server diff --git a/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties b/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties index 1edcc82520..2081488e14 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties +++ b/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties @@ -19,6 +19,7 @@ dubbo.application.name=dubbo-samples-xds-provider dubbo.application.metadataServicePort=20885 dubbo.registry.address=xds://istiod.istio-system.svc:15012 +#dubbo.registry.address=xds://istiod.istio-system.svc:15012?use-agent=true dubbo.protocol.name=tri dubbo.protocol.port=50051 dubbo.application.qosEnable=true From 1da223a0ed462e457d3b9b47b376a314deee9757 Mon Sep 17 00:00:00 2001 From: chenyanlann <32511cyl@gmail.com> Date: Thu, 10 Nov 2022 15:30:50 +0800 Subject: [PATCH 2/5] refactor the code --- dubbo-samples-xds-agent/deploy/Namespace.yml | 4 + .../dubbo-samples-xds-consumer/Dockerfile | 3 + .../dubbo-samples-xds-consumer/pom.xml | 233 ++++++++++++++++++ .../dubbo/samples/ConsumerBootstrap.java | 54 ++++ .../action/GreetingServiceConsumer.java | 37 +++ .../dubbo/samples/api/GreetingService.java | 26 ++ .../src/main/resources/k8s/Deployment.yml | 39 +++ .../src/main/resources/k8s/Service.yml | 14 ++ .../src/main/resources/log4j.properties | 23 ++ .../spring/dubbo-consumer.properties | 25 ++ .../dubbo-samples-xds-provider/Dockerfile | 3 + .../dubbo-samples-xds-provider/pom.xml | 232 +++++++++++++++++ .../dubbo/samples/ProviderBootstrap.java | 44 ++++ .../dubbo/samples/api/GreetingService.java | 26 ++ .../impl/AnnotatedGreetingService.java | 35 +++ .../src/main/resources/k8s/Deployment.yml | 39 +++ .../src/main/resources/k8s/Service.yml | 14 ++ .../src/main/resources/log4j.properties | 23 ++ .../spring/dubbo-provider.properties | 25 ++ dubbo-samples-xds-agent/pom.xml | 51 ++++ .../dubbo-samples-xds-consumer/pom.xml | 2 +- .../src/main/resources/k8s/Deployment.yml | 3 - .../spring/dubbo-consumer.properties | 1 - .../dubbo-samples-xds-provider/pom.xml | 2 +- .../src/main/resources/k8s/Deployment.yml | 3 - .../spring/dubbo-provider.properties | 1 - 26 files changed, 952 insertions(+), 10 deletions(-) create mode 100644 dubbo-samples-xds-agent/deploy/Namespace.yml create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-consumer/Dockerfile create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-consumer/pom.xml create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/ConsumerBootstrap.java create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/action/GreetingServiceConsumer.java create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/api/GreetingService.java create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Service.yml create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/log4j.properties create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-provider/Dockerfile create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-provider/pom.xml create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/ProviderBootstrap.java create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/api/GreetingService.java create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/impl/AnnotatedGreetingService.java create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Service.yml create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/log4j.properties create mode 100644 dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties create mode 100644 dubbo-samples-xds-agent/pom.xml diff --git a/dubbo-samples-xds-agent/deploy/Namespace.yml b/dubbo-samples-xds-agent/deploy/Namespace.yml new file mode 100644 index 0000000000..9816fb9b0e --- /dev/null +++ b/dubbo-samples-xds-agent/deploy/Namespace.yml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: dubbo-demo \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/Dockerfile b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/Dockerfile new file mode 100644 index 0000000000..04734e95b0 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/Dockerfile @@ -0,0 +1,3 @@ +FROM openjdk:8-jdk +ADD ./target/dubbo-samples-xds-consumer-1.0-SNAPSHOT.jar dubbo-samples-xds-consumer-1.0-SNAPSHOT.jar +CMD java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=31000 /dubbo-samples-xds-consumer-1.0-SNAPSHOT.jar \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/pom.xml b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/pom.xml new file mode 100644 index 0000000000..c76b0e74bc --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/pom.xml @@ -0,0 +1,233 @@ + + + + + org.apache.dubbo + 1.0-SNAPSHOT + + 4.0.0 + + dubbo-samples-xds-consumer + + + 1.8 + 1.8 + 3.1.2 + 4.3.16.RELEASE + 4.12 + 3.7.0 + + + + + + org.springframework + spring-framework-bom + ${spring.version} + pom + import + + + org.apache.dubbo + dubbo-bom + ${dubbo.version} + pom + import + + + org.apache.dubbo + dubbo-dependencies-bom + ${dubbo.version} + pom + import + + + + + + + org.apache.dubbo + dubbo + + + + junit + junit + ${junit.version} + test + + + org.apache.dubbo + dubbo-xds + ${dubbo.version} + + + + org.springframework + spring-test + test + + + + org.springframework + spring-context + + + + io.grpc + grpc-protobuf + + + + io.grpc + grpc-stub + + + + io.grpc + grpc-netty-shaded + + + + io.envoyproxy.controlplane + api + + + + com.google.protobuf + protobuf-java-util + + + + org.bouncycastle + bcprov-jdk15on + + + org.bouncycastle + bcpkix-jdk15on + + + org.bouncycastle + bcprov-ext-jdk15on + + + + + + + + javax.annotation + + [1.11,) + + + + javax.annotation + javax.annotation-api + 1.3.2 + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${source.level} + ${target.level} + + + + org.springframework.boot + spring-boot-maven-plugin + 2.6.4 + + org.apache.dubbo.samples.ConsumerBootstrap + + apache/dubbo-demo:${project.artifactId}_0.0.1 + + + + + + org.apache.maven.plugins + maven-shade-plugin + 2.4.1 + + + package + + shade + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + org.apache.dubbo.samples.ConsumerBootstrap + + + META-INF/dubbo/internal/org.apache.dubbo.registry.client.ServiceDiscoveryFactory + + + META-INF/dubbo/internal/org.apache.dubbo.registry.RegistryFactory + + + + + + + + + + + + apache.snapshots.https + Apache Development Snapshot Repository + https://repository.apache.org/content/repositories/snapshots + default + + false + + + true + daily + + + + + \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/ConsumerBootstrap.java b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/ConsumerBootstrap.java new file mode 100644 index 0000000000..304e47de55 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/ConsumerBootstrap.java @@ -0,0 +1,54 @@ +/* + * + * 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. + * + */ + +package org.apache.dubbo.samples; + +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.apache.dubbo.samples.action.GreetingServiceConsumer; + +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; + +public class ConsumerBootstrap { + + public static void main(String[] args) { + AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConsumerConfiguration.class); + context.start(); + GreetingServiceConsumer greetingServiceConsumer = context.getBean(GreetingServiceConsumer.class); + while (true) { + try { + String hello = greetingServiceConsumer.doSayHello("xDS Consumer"); + System.out.println("result: " + hello); + Thread.sleep(100); + } catch (Throwable t) { + t.printStackTrace(); + } + } + } + + @Configuration + @EnableDubbo(scanBasePackages = "org.apache.dubbo.samples.action") + @PropertySource("classpath:/spring/dubbo-consumer.properties") + @ComponentScan(value = {"org.apache.dubbo.samples.action"}) + static class ConsumerConfiguration { + + } +} diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/action/GreetingServiceConsumer.java b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/action/GreetingServiceConsumer.java new file mode 100644 index 0000000000..b5c9abdcd5 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/action/GreetingServiceConsumer.java @@ -0,0 +1,37 @@ +/* + * + * 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. + * + */ + +package org.apache.dubbo.samples.action; + +import org.apache.dubbo.config.annotation.DubboReference; +import org.apache.dubbo.samples.api.GreetingService; + +import org.springframework.stereotype.Component; + +@Component("annotatedConsumer") +public class GreetingServiceConsumer { + + @DubboReference(version = "1.0.0", providedBy = "dubbo-samples-xds-provider") + private GreetingService greetingService; + + public String doSayHello(String name) { + return greetingService.sayHello(name); + } + +} diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/api/GreetingService.java b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/api/GreetingService.java new file mode 100644 index 0000000000..997ece7e02 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/java/org/apache/dubbo/samples/api/GreetingService.java @@ -0,0 +1,26 @@ +/* + * + * 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. + * + */ + +package org.apache.dubbo.samples.api; + +public interface GreetingService { + + String sayHello(String name); + +} diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml new file mode 100644 index 0000000000..db278588ac --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dubbo-samples-xds-consumer + namespace: dubbo-demo +spec: + replicas: 2 + selector: + matchLabels: + app: dubbo-samples-xds-consumer + template: + metadata: + labels: + app: dubbo-samples-xds-consumer + annotations: + inject.istio.io/templates: grpc-agent + proxy.istio.io/config: '{"holdApplicationUntilProxyStarts": true}' + spec: + containers: + - name: server + image: apache/dubbo-demo:dubbo-samples-xds-consumer_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/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Service.yml b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Service.yml new file mode 100644 index 0000000000..1e7eeca1eb --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Service.yml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: dubbo-samples-xds-consumer + namespace: dubbo-demo +spec: + clusterIP: None + selector: + app: dubbo-samples-xds-consumer + ports: + - name: grpc + protocol: TCP + port: 50051 + targetPort: 50051 \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/log4j.properties b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/log4j.properties new file mode 100644 index 0000000000..9e04984bdc --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/log4j.properties @@ -0,0 +1,23 @@ +# +# +# 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. +# +# +log4j.rootLogger=info, stdout +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=[%d{dd/MM/yy hh:mm:ss:sss z}] %t %5p %c{2}: %m%n \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties new file mode 100644 index 0000000000..ec830c66b0 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties @@ -0,0 +1,25 @@ +# +# +# 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. +# +# +dubbo.application.name=dubbo-samples-xds-consumer +dubbo.application.metadataServicePort=20885 +dubbo.registry.address=xds://istiod.istio-system.svc:15012?use-agent=true +dubbo.consumer.timeout=3000 +dubbo.consumer.check=false +dubbo.application.qosEnable=true +dubbo.application.qosAcceptForeignIp=true \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/Dockerfile b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/Dockerfile new file mode 100644 index 0000000000..38c6d220f0 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/Dockerfile @@ -0,0 +1,3 @@ +FROM openjdk:8-jdk +ADD ./target/dubbo-samples-xds-provider-1.0-SNAPSHOT.jar dubbo-samples-xds-provider-1.0-SNAPSHOT.jar +CMD java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=31000 /dubbo-samples-xds-provider-1.0-SNAPSHOT.jar \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/pom.xml b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/pom.xml new file mode 100644 index 0000000000..10e880b5f3 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/pom.xml @@ -0,0 +1,232 @@ + + + + + org.apache.dubbo + 1.0-SNAPSHOT + + 4.0.0 + + dubbo-samples-xds-provider + + + 1.8 + 1.8 + 3.1.2 + 4.3.16.RELEASE + 4.12 + 3.7.0 + + + + + + org.springframework + spring-framework-bom + ${spring.version} + pom + import + + + org.apache.dubbo + dubbo-bom + ${dubbo.version} + pom + import + + + org.apache.dubbo + dubbo-dependencies-bom + ${dubbo.version} + pom + import + + + + + + + org.apache.dubbo + dubbo + + + org.apache.dubbo + dubbo-xds + ${dubbo.version} + + + + junit + junit + ${junit.version} + test + + + + org.springframework + spring-test + test + + + + org.springframework + spring-context + + + + io.grpc + grpc-protobuf + + + + io.grpc + grpc-stub + + + + io.grpc + grpc-netty-shaded + + + + io.envoyproxy.controlplane + api + + + + com.google.protobuf + protobuf-java-util + + + + org.bouncycastle + bcprov-jdk15on + + + org.bouncycastle + bcpkix-jdk15on + + + org.bouncycastle + bcprov-ext-jdk15on + + + + + + + + javax.annotation + + [1.11,) + + + + javax.annotation + javax.annotation-api + 1.3.2 + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${source.level} + ${target.level} + + + + org.springframework.boot + spring-boot-maven-plugin + 2.6.4 + + org.apache.dubbo.samples.ProviderBootstrap + + apache/dubbo-demo:${project.artifactId}_0.0.1 + IF_NOT_PRESENT + + + + + org.apache.maven.plugins + maven-shade-plugin + 2.4.1 + + + package + + shade + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + org.apache.dubbo.samples.ProviderBootstrap + + + META-INF/dubbo/internal/org.apache.dubbo.registry.client.ServiceDiscoveryFactory + + + META-INF/dubbo/internal/org.apache.dubbo.registry.RegistryFactory + + + + + + + + + + + + apache.snapshots.https + Apache Development Snapshot Repository + https://repository.apache.org/content/repositories/snapshots + default + + false + + + true + daily + + + + + \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/ProviderBootstrap.java b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/ProviderBootstrap.java new file mode 100644 index 0000000000..7a494a2789 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/ProviderBootstrap.java @@ -0,0 +1,44 @@ +/* + * + * 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. + * + */ + +package org.apache.dubbo.samples; + +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; + +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; + +import java.util.concurrent.CountDownLatch; + +public class ProviderBootstrap { + + public static void main(String[] args) throws Exception { + AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ProviderConfiguration.class); + context.start(); + System.out.println("dubbo service started"); + new CountDownLatch(1).await(); + } + + @Configuration + @EnableDubbo(scanBasePackages = "org.apache.dubbo.samples.impl") + @PropertySource("classpath:/spring/dubbo-provider.properties") + static class ProviderConfiguration { + } +} diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/api/GreetingService.java b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/api/GreetingService.java new file mode 100644 index 0000000000..997ece7e02 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/api/GreetingService.java @@ -0,0 +1,26 @@ +/* + * + * 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. + * + */ + +package org.apache.dubbo.samples.api; + +public interface GreetingService { + + String sayHello(String name); + +} diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/impl/AnnotatedGreetingService.java b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/impl/AnnotatedGreetingService.java new file mode 100644 index 0000000000..f47ded8817 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/java/org/apache/dubbo/samples/impl/AnnotatedGreetingService.java @@ -0,0 +1,35 @@ +/* + * + * 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. + * + */ + +package org.apache.dubbo.samples.impl; + +import org.apache.dubbo.common.utils.NetUtils; +import org.apache.dubbo.config.annotation.DubboService; +import org.apache.dubbo.samples.api.GreetingService; + +@DubboService(version = "1.0.0") +public class AnnotatedGreetingService implements GreetingService { + + @Override + public String sayHello(String name) { + System.out.println("greeting service received: " + name); + return "hello, " + name + "! from host: " + NetUtils.getLocalHost(); + } + +} diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml new file mode 100644 index 0000000000..4b4d7287aa --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dubbo-samples-xds-provider + namespace: dubbo-demo +spec: + replicas: 3 + selector: + matchLabels: + app: dubbo-samples-xds-provider + template: + metadata: + labels: + app: dubbo-samples-xds-provider + annotations: + inject.istio.io/templates: grpc-agent + proxy.istio.io/config: '{"holdApplicationUntilProxyStarts": true}' + 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 + 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/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Service.yml b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Service.yml new file mode 100644 index 0000000000..8009868f59 --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Service.yml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: dubbo-samples-xds-provider + namespace: dubbo-demo +spec: + clusterIP: None + selector: + app: dubbo-samples-xds-provider + ports: + - name: grpc + protocol: TCP + port: 50051 + targetPort: 50051 \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/log4j.properties b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/log4j.properties new file mode 100644 index 0000000000..9e04984bdc --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/log4j.properties @@ -0,0 +1,23 @@ +# +# +# 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. +# +# +log4j.rootLogger=info, stdout +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=[%d{dd/MM/yy hh:mm:ss:sss z}] %t %5p %c{2}: %m%n \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties new file mode 100644 index 0000000000..48b2eb5dcc --- /dev/null +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties @@ -0,0 +1,25 @@ +# +# +# 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. +# +# +dubbo.application.name=dubbo-samples-xds-provider +dubbo.application.metadataServicePort=20885 +dubbo.registry.address=xds://istiod.istio-system.svc:15012?use-agent=true +dubbo.protocol.name=tri +dubbo.protocol.port=50051 +dubbo.application.qosEnable=true +dubbo.application.qosAcceptForeignIp=true \ No newline at end of file diff --git a/dubbo-samples-xds-agent/pom.xml b/dubbo-samples-xds-agent/pom.xml new file mode 100644 index 0000000000..bcafabf449 --- /dev/null +++ b/dubbo-samples-xds-agent/pom.xml @@ -0,0 +1,51 @@ + + + + + org.apache.dubbo + 1.0-SNAPSHOT + + dubbo-samples-xds-provider + dubbo-samples-xds-consumer + + + 4.0.0 + pom + dubbo-samples-xds + + + + apache.snapshots.https + Apache Development Snapshot Repository + https://repository.apache.org/content/repositories/snapshots + default + + false + + + true + daily + + + + + \ No newline at end of file diff --git a/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml b/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml index c76b0e74bc..e2bd7d8cc7 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml +++ b/dubbo-samples-xds/dubbo-samples-xds-consumer/pom.xml @@ -31,7 +31,7 @@ 1.8 1.8 - 3.1.2 + 3.1.0 4.3.16.RELEASE 4.12 3.7.0 diff --git a/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml b/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml index 95853242c1..bb9a9b85d6 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml +++ b/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml @@ -12,9 +12,6 @@ spec: metadata: labels: app: dubbo-samples-xds-consumer -# annotations: -# inject.istio.io/templates: grpc-agent -# proxy.istio.io/config: '{"holdApplicationUntilProxyStarts": true}' spec: containers: - name: server diff --git a/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties b/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties index f8c359240c..e866c68df9 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties +++ b/dubbo-samples-xds/dubbo-samples-xds-consumer/src/main/resources/spring/dubbo-consumer.properties @@ -19,7 +19,6 @@ dubbo.application.name=dubbo-samples-xds-consumer dubbo.application.metadataServicePort=20885 dubbo.registry.address=xds://istiod.istio-system.svc:15012 -#dubbo.registry.address=xds://istiod.istio-system.svc:15012?use-agent=true dubbo.consumer.timeout=3000 dubbo.consumer.check=false dubbo.application.qosEnable=true diff --git a/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml b/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml index 10e880b5f3..adb67b11bd 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml +++ b/dubbo-samples-xds/dubbo-samples-xds-provider/pom.xml @@ -31,7 +31,7 @@ 1.8 1.8 - 3.1.2 + 3.1.0 4.3.16.RELEASE 4.12 3.7.0 diff --git a/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml b/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml index d252c7a8a8..81697488ed 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml +++ b/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml @@ -12,9 +12,6 @@ spec: metadata: labels: app: dubbo-samples-xds-provider -# annotations: -# inject.istio.io/templates: grpc-agent -# proxy.istio.io/config: '{"holdApplicationUntilProxyStarts": true}' spec: containers: - name: server diff --git a/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties b/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties index 2081488e14..1edcc82520 100644 --- a/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties +++ b/dubbo-samples-xds/dubbo-samples-xds-provider/src/main/resources/spring/dubbo-provider.properties @@ -19,7 +19,6 @@ dubbo.application.name=dubbo-samples-xds-provider dubbo.application.metadataServicePort=20885 dubbo.registry.address=xds://istiod.istio-system.svc:15012 -#dubbo.registry.address=xds://istiod.istio-system.svc:15012?use-agent=true dubbo.protocol.name=tri dubbo.protocol.port=50051 dubbo.application.qosEnable=true From 6a74935ea900c73df17edae1b5466f976821c065 Mon Sep 17 00:00:00 2001 From: chenyanlann <62465397+chenyanlann@users.noreply.github.com> Date: Fri, 2 Dec 2022 21:13:23 +0800 Subject: [PATCH 3/5] Update Namespace.yml --- dubbo-samples-xds-agent/deploy/Namespace.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dubbo-samples-xds-agent/deploy/Namespace.yml b/dubbo-samples-xds-agent/deploy/Namespace.yml index 9816fb9b0e..77373f9295 100644 --- a/dubbo-samples-xds-agent/deploy/Namespace.yml +++ b/dubbo-samples-xds-agent/deploy/Namespace.yml @@ -1,4 +1,20 @@ +# 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: v1 kind: Namespace metadata: - name: dubbo-demo \ No newline at end of file + name: dubbo-demo From bd5390bc80ea59b134f983c325626969d989a724 Mon Sep 17 00:00:00 2001 From: chenyanlann <32511cyl@gmail.com> Date: Fri, 2 Dec 2022 21:20:20 +0800 Subject: [PATCH 4/5] add AFS --- dubbo-samples-xds-agent/deploy/Namespace.yml | 16 ++++++++++++++++ .../src/main/resources/k8s/Deployment.yml | 16 ++++++++++++++++ .../src/main/resources/k8s/Service.yml | 16 ++++++++++++++++ .../src/main/resources/k8s/Deployment.yml | 16 ++++++++++++++++ .../src/main/resources/k8s/Service.yml | 16 ++++++++++++++++ 5 files changed, 80 insertions(+) diff --git a/dubbo-samples-xds-agent/deploy/Namespace.yml b/dubbo-samples-xds-agent/deploy/Namespace.yml index 9816fb9b0e..92c5bea3d7 100644 --- a/dubbo-samples-xds-agent/deploy/Namespace.yml +++ b/dubbo-samples-xds-agent/deploy/Namespace.yml @@ -1,3 +1,19 @@ +# 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: v1 kind: Namespace metadata: diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml index db278588ac..6fd06971db 100644 --- a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml @@ -1,3 +1,19 @@ +# 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: diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Service.yml b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Service.yml index 1e7eeca1eb..7c63eebae5 100644 --- a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Service.yml +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Service.yml @@ -1,3 +1,19 @@ +# 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: v1 kind: Service metadata: diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml index 4b4d7287aa..b81807ded5 100644 --- a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml @@ -1,3 +1,19 @@ +# 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: diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Service.yml b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Service.yml index 8009868f59..98f47ac756 100644 --- a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Service.yml +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Service.yml @@ -1,3 +1,19 @@ +# 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: v1 kind: Service metadata: From 9203df8529b59c745b20808c0b9200f6f39985aa Mon Sep 17 00:00:00 2001 From: chenyanlann <32511cyl@gmail.com> Date: Fri, 2 Dec 2022 21:22:46 +0800 Subject: [PATCH 5/5] add AFS --- .../dubbo-samples-xds-consumer/Dockerfile | 15 +++++++++++++++ .../dubbo-samples-xds-provider/Dockerfile | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/Dockerfile b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/Dockerfile index 04734e95b0..2d9d081ce7 100644 --- a/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/Dockerfile +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/Dockerfile @@ -1,3 +1,18 @@ +# 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. + FROM openjdk:8-jdk ADD ./target/dubbo-samples-xds-consumer-1.0-SNAPSHOT.jar dubbo-samples-xds-consumer-1.0-SNAPSHOT.jar CMD java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=31000 /dubbo-samples-xds-consumer-1.0-SNAPSHOT.jar \ No newline at end of file diff --git a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/Dockerfile b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/Dockerfile index 38c6d220f0..716f39ec14 100644 --- a/dubbo-samples-xds-agent/dubbo-samples-xds-provider/Dockerfile +++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/Dockerfile @@ -1,3 +1,18 @@ +# 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. + FROM openjdk:8-jdk ADD ./target/dubbo-samples-xds-provider-1.0-SNAPSHOT.jar dubbo-samples-xds-provider-1.0-SNAPSHOT.jar CMD java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=31000 /dubbo-samples-xds-provider-1.0-SNAPSHOT.jar \ No newline at end of file