Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj committed Sep 7, 2024
1 parent 7534be7 commit f289449
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 4 deletions.
1 change: 1 addition & 0 deletions 11-quickstart/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ARG APP_FILE

# Remember to change the port according to the RPC protocol you select
EXPOSE 50051
EXPOSE 22222

# copy the JAR file into the root and rename
RUN cp ./quickstart-service/target/${APP_FILE} app.jar
Expand Down
120 changes: 120 additions & 0 deletions 11-quickstart/Kubernetes-manifests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Namespace
apiVersion: v1
kind: Namespace
metadata:
name: dubbo-quickstart
---
apiVersion: v1
kind: Namespace
metadata:
name: dubbo-system
---

# Nacos
apiVersion: apps/v1
kind: Deployment
metadata:
name: nacos
namespace: dubbo-system
spec:
replicas: 1
selector:
matchLabels:
app: nacos
template:
metadata:
labels:
app: nacos
spec:
containers:
- name: consumer
image: nacos-registry.cn-hangzhou.cr.aliyuncs.com/nacos/nacos-server:v2.1.2
imagePullPolicy: Always
resources:
requests:
memory: "2Gi"
cpu: "500m"
ports:
- containerPort: 8848
name: client
- containerPort: 9848
name: client-rpc
env:
- name: NACOS_SERVER_PORT
value: "8848"
- name: NACOS_APPLICATION_PORT
value: "8848"
- name: PREFER_HOST_MODE
value: "hostname"
- name: MODE
value: "standalone"
- name: NACOS_AUTH_ENABLE
value: "true"
---
apiVersion: v1
kind: Service
metadata:
name: nacos
namespace: dubbo-system
spec:
type: ClusterIP
sessionAffinity: None
selector:
app: nacos
ports:
- port: 8848
name: server
targetPort: 8848
- port: 9848
name: client-rpc
targetPort: 9848
---

apiVersion: apps/v1
kind: Deployment
metadata:
name: quickstart
namespace: dubbo-quickstart
spec:
replicas: 1
selector:
matchLabels:
app: quickstart
template:
metadata:
labels:
app: quickstart
spec:
containers:
- name: quickstart
image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/dubbo-quickstart:1.0
imagePullPolicy: Always
ports:
- name: dubbo
containerPort: 50051
protocol: TCP
- name: dubbo-qos
containerPort: 22222
protocol: TCP
env:
- name: JAVA_TOOL_OPTIONS
value: "-Dnacos.address=nacos.dubbo-system.svc"
---

apiVersion: v1
kind: Service
metadata:
name: quickstart
namespace: dubbo-quickstart
spec:
selector:
app: quickstart
ports:
- name: tcp
port: 50051
targetPort: 50051
- name: http
port: 22222
targetPort: 22222
---

1 change: 0 additions & 1 deletion 11-quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ For further reference, please consider the following sections:
* [Dubbo triple protocol reference](https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/protocol/triple/)
* [Dubbo Zookeeper registry configuration reference](https://docs.spring.io/spring-boot/docs/3.1.2/reference/htmlsingle/#web.servlet.spring-mvc.template-engines)


Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

dubbo:
registry:
address: zookeeper://${zookeeper.address:127.0.0.1}:2181
address: nacos://${nacos.address:127.0.0.1}:8848
protocol:
name: tri
port: 50051
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title th:text="${is_cymbal_brand} ? 'Cymbal Shops' : 'Online Boutique'"></title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<link href="../static/styles/bootstrap.min.css" rel="stylesheet" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<head>
<title>Home</title>
<link rel="stylesheet" th:href="@{/styles/styles.css}">
<link rel="stylesheet" href="../static/bootstrap.min.css">
<link rel="stylesheet" href="../static/styles/bootstrap.min.css">

</head>
<body>
Expand Down

0 comments on commit f289449

Please sign in to comment.