This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git
The following commit(s) were added to refs/heads/master by this push:
new 86fa8dc1 Dubbo samples mesh k8s (#470)
86fa8dc1 is described below
commit 86fa8dc1adb95c577c65451502a74d172d5109ff
Author: conghuhu <[email protected]>
AuthorDate: Fri Jul 15 12:47:15 2022 +0800
Dubbo samples mesh k8s (#470)
---
dubbo-samples-mesh-k8s/README.md | 15 +++++------
.../dubbo-samples-mesh-consumer/pom.xml | 4 +--
.../src/main/resources/k8s/Deployment.yml | 26 +++++++++++--------
.../dubbo-samples-mesh-provider/pom.xml | 6 ++---
.../src/main/resources/k8s/Deployment.yml | 29 ++++++++++++++--------
5 files changed, 46 insertions(+), 34 deletions(-)
diff --git a/dubbo-samples-mesh-k8s/README.md b/dubbo-samples-mesh-k8s/README.md
index 79c5ccdc..0499ca2a 100644
--- a/dubbo-samples-mesh-k8s/README.md
+++ b/dubbo-samples-mesh-k8s/README.md
@@ -12,8 +12,8 @@
## 2 基本流程
1. 创建一个 Dubbo
- 应用(
[dubbo-samples-kubernetes](https://github.com/apache/dubbo-samples/tree/master/dubbo-samples-kubernetes)
)
-2. 构建容器镜像并推送到镜像仓库( [dubboteam 示例例镜像](https://hub.docker.com/u/dubboteam) )
+ 应用(
[dubbo-samples-kubernetes](https://github.com/apache/dubbo-samples/tree/master/dubbo-samples-mesh-k8s)
)
+2. 构建容器镜像并推送到镜像仓库( [dubbomesh 示例例镜像](https://hub.docker.com/u/15841721425) )
3. 分别部署 Dubbo Provider 与 Dubbo Consumer 到 Kubernetes
4. 验证服务发现与调用正常
@@ -80,13 +80,8 @@ kubectl label namespace dubbo-demo istio-injection=enabled
前提是本地需要对 dubbo 3.1.0-SNAPSHOT mvn install 后。
```xml
-
-<dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo</artifactId>
- <!-- <version>${dubbo.version}</version>-->
- <version>3.1.0-SNAPSHOT</version>
-</dependency>
+<dubbo.version>3.1.0-SNAPSHOT</dubbo.version>
+<!--<dubbo.version>3.0.7</dubbo.version>-->
```
设置 Dubbo 项目使用 Kubernetes 作为注册中心,这里通过 DEFAULT_MASTER_HOST指定使用默认 API-SERVER 集群地址
kubernetes.default.srv,同时还指定了
@@ -113,6 +108,8 @@ docker build -f ./Dockerfile -t dubbo-samples-mesh-provider
.
cd dubbo-samples-mesh-consumer
docker build -f ./Dockerfile -t dubbo-samples-mesh-consumer .
+# 下面的15841721425是私人地址,大家用的时候推到自己的仓库即可
+
# 重命名镜像
docker tag dubbo-samples-mesh-provider:latest
15841721425/dubbo-samples-mesh-provider
diff --git a/dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/pom.xml
b/dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/pom.xml
index d4f90bac..359a4e53 100644
--- a/dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/pom.xml
+++ b/dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/pom.xml
@@ -30,13 +30,14 @@
<properties>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
+ <!-- <dubbo.version>3.1.0-SNAPSHOT</dubbo.version>-->
<dubbo.version>3.0.7</dubbo.version>
<spring.version>4.3.16.RELEASE</spring.version>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<grpc.version>1.31.1</grpc.version>
<protoc.version>3.19.4</protoc.version>
- <dubbo.compiler.version>0.0.4.1-SNAPSHOT</dubbo.compiler.version>
+ <dubbo.compiler.version>0.0.4.1</dubbo.compiler.version>
</properties>
<dependencyManagement>
@@ -63,7 +64,6 @@
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
-<!-- <version>3.1.0-SNAPSHOT</version>-->
</dependency>
<dependency>
diff --git
a/dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/src/main/resources/k8s/Deployment.yml
b/dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/src/main/resources/k8s/Deployment.yml
index 32cdb620..50eb7bdd 100644
---
a/dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/src/main/resources/k8s/Deployment.yml
+++
b/dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/src/main/resources/k8s/Deployment.yml
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
- name: dubbo-samples-apiserver-consumer
+ name: dubbo-samples-mesh-consumer
namespace: dubbo-demo
spec:
replicas: 1
@@ -26,20 +26,26 @@ spec:
- containerPort: 31000
protocol: TCP
livenessProbe:
- httpGet:
- path: /live
- port: 22222
+ # httpGet:
+ # path: /live
+ # port: 22222
+ grpc:
+ port: 20880
initialDelaySeconds: 5
periodSeconds: 5
readinessProbe:
- httpGet:
- path: /ready
- port: 22222
+ # httpGet:
+ # path: /ready
+ # port: 22222
+ grpc:
+ port: 20880
initialDelaySeconds: 5
periodSeconds: 5
startupProbe:
- httpGet:
- path: /startup
- port: 22222
+ # httpGet:
+ # path: /startup
+ # port: 22222
+ grpc:
+ port: 20880
failureThreshold: 30
periodSeconds: 10
\ No newline at end of file
diff --git a/dubbo-samples-mesh-k8s/dubbo-samples-mesh-provider/pom.xml
b/dubbo-samples-mesh-k8s/dubbo-samples-mesh-provider/pom.xml
index fd941afa..3440bb70 100644
--- a/dubbo-samples-mesh-k8s/dubbo-samples-mesh-provider/pom.xml
+++ b/dubbo-samples-mesh-k8s/dubbo-samples-mesh-provider/pom.xml
@@ -11,13 +11,14 @@
<properties>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
- <dubbo.version>3.1.0-SNAPSHOT</dubbo.version>
+<!-- <dubbo.version>3.1.0-SNAPSHOT</dubbo.version>-->
+ <dubbo.version>3.0.7</dubbo.version>
<grpc.version>1.31.1</grpc.version>
<spring.version>4.3.16.RELEASE</spring.version>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<protoc.version>3.19.4</protoc.version>
- <dubbo.compiler.version>0.0.4.1-SNAPSHOT</dubbo.compiler.version>
+ <dubbo.compiler.version>0.0.4.1</dubbo.compiler.version>
</properties>
<dependencyManagement>
@@ -44,7 +45,6 @@
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
- <!-- <version>3.1.0-SNAPSHOT</version>-->
</dependency>
<dependency>
diff --git
a/dubbo-samples-mesh-k8s/dubbo-samples-mesh-provider/src/main/resources/k8s/Deployment.yml
b/dubbo-samples-mesh-k8s/dubbo-samples-mesh-provider/src/main/resources/k8s/Deployment.yml
index dbed26cb..f5da9869 100644
---
a/dubbo-samples-mesh-k8s/dubbo-samples-mesh-provider/src/main/resources/k8s/Deployment.yml
+++
b/dubbo-samples-mesh-k8s/dubbo-samples-mesh-provider/src/main/resources/k8s/Deployment.yml
@@ -4,7 +4,7 @@ metadata:
name: dubbo-samples-mesh-provider
namespace: dubbo-demo
spec:
- replicas: 2
+ replicas: 3
selector:
matchLabels:
app: dubbo-samples-mesh-provider
@@ -26,20 +26,29 @@ spec:
- containerPort: 31000
protocol: TCP
livenessProbe:
- httpGet:
- path: /live
- port: 22222
+ # httpGet:
+ # path: /live
+ # port: 22222
+ grpc:
+ port: 50052
+# service: Health
initialDelaySeconds: 5
periodSeconds: 5
readinessProbe:
- httpGet:
- path: /ready
- port: 22222
+ # httpGet:
+ # path: /ready
+ # port: 22222
+ grpc:
+ port: 50052
+# service: Health
initialDelaySeconds: 5
periodSeconds: 5
startupProbe:
- httpGet:
- path: /startup
- port: 22222
+ # httpGet:
+ # path: /startup
+ # port: 22222
+ grpc:
+ port: 50052
+# service: Health
failureThreshold: 30
periodSeconds: 10
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]