diff --git a/dubbo-samples-xds-agent/deploy/Namespace.yml b/dubbo-samples-xds-agent/deploy/Namespace.yml
new file mode 100644
index 0000000000..77373f9295
--- /dev/null
+++ b/dubbo-samples-xds-agent/deploy/Namespace.yml
@@ -0,0 +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
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..2d9d081ce7
--- /dev/null
+++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/Dockerfile
@@ -0,0 +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-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..6fd06971db
--- /dev/null
+++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Deployment.yml
@@ -0,0 +1,55 @@
+# 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-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..7c63eebae5
--- /dev/null
+++ b/dubbo-samples-xds-agent/dubbo-samples-xds-consumer/src/main/resources/k8s/Service.yml
@@ -0,0 +1,30 @@
+# 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:
+ 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..716f39ec14
--- /dev/null
+++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/Dockerfile
@@ -0,0 +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
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..b81807ded5
--- /dev/null
+++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Deployment.yml
@@ -0,0 +1,55 @@
+# 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
+ 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..98f47ac756
--- /dev/null
+++ b/dubbo-samples-xds-agent/dubbo-samples-xds-provider/src/main/resources/k8s/Service.yml
@@ -0,0 +1,30 @@
+# 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:
+ 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