Skip to content

Commit 716ecb7

Browse files
committed
docs(cloud-config-demo): enhence Kubernetes cluster usages
Signed-off-by: lony2003 <zhangke200377@outlook.com>
1 parent 74e36d4 commit 716ecb7

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package io.dapr.springboot.examples.cloudconfig;
2+
3+
import io.dapr.springboot.examples.cloudconfig.config.SingleConfig;
4+
import org.springframework.web.bind.annotation.GetMapping;
5+
import org.springframework.web.bind.annotation.RestController;
6+
7+
@RestController
8+
public class DemoController {
9+
10+
private final SingleConfig singleConfig;
11+
12+
public DemoController(SingleConfig singleConfig) {
13+
this.singleConfig = singleConfig;
14+
}
15+
16+
@GetMapping("/config")
17+
public String getConfig() {
18+
return singleConfig.getSingleValueSecret();
19+
}
20+
21+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
app: cloud-config-demo
6+
name: cloud-config-demo
7+
spec:
8+
type: NodePort
9+
ports:
10+
- name: "cloud-config-demo"
11+
port: 8080
12+
targetPort: 8080
13+
nodePort: 31002
14+
selector:
15+
app: cloud-config-demo
16+
17+
---
18+
19+
apiVersion: apps/v1
20+
kind: Deployment
21+
metadata:
22+
labels:
23+
app: cloud-config-demo
24+
name: cloud-config-demo
25+
spec:
26+
replicas: 1
27+
selector:
28+
matchLabels:
29+
app: cloud-config-demo
30+
template:
31+
metadata:
32+
annotations:
33+
dapr.io/app-id: cloud-config-demo
34+
dapr.io/app-port: "8080"
35+
dapr.io/enabled: "true"
36+
labels:
37+
app: cloud-config-demo
38+
spec:
39+
containers:
40+
- image: localhost:5001/sb-cloud-config-demo
41+
name: cloud-config-demo
42+
imagePullPolicy: Always
43+
ports:
44+
- containerPort: 8080
45+
name: cloud-config

spring-boot-examples/kubernetes/secretstore.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ metadata:
55
spec:
66
type: secretstores.kubernetes
77
version: v1
8+
metadata: []

0 commit comments

Comments
 (0)