-
Notifications
You must be signed in to change notification settings - Fork 17
/
demo.yaml
95 lines (95 loc) · 1.77 KB
/
demo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
apiVersion: v1
kind: Namespace
metadata:
name: kuma-demo
labels:
kuma.io/sidecar-injection: enabled
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
namespace: kuma-demo
spec:
selector:
matchLabels:
app: redis
replicas: 1
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: "redis"
ports:
- name: tcp
containerPort: 6379
lifecycle:
preStop: # delay shutdown to support graceful mesh leave
exec:
command: ["/bin/sleep", "30"]
postStart:
exec:
command: ["/usr/local/bin/redis-cli", "set", "zone", "local"]
---
apiVersion: v1
kind: Service
metadata:
name: redis
namespace: kuma-demo
labels:
app: redis
spec:
selector:
app: redis
ports:
- protocol: TCP
port: 6379
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo-app
namespace: kuma-demo
spec:
selector:
matchLabels:
app: demo-app
replicas: 1
template:
metadata:
labels:
app: demo-app
spec:
containers:
- name: demo-app
image: "kumahq/kuma-demo"
env:
- name: REDIS_HOST
value: "redis.kuma-demo.svc.cluster.local"
- name: REDIS_PORT
value: "6379"
- name: APP_VERSION
value: "1.0"
- name: APP_COLOR
value: "#efefef"
ports:
- name: http
containerPort: 5000
---
apiVersion: v1
kind: Service
metadata:
name: demo-app
namespace: kuma-demo
labels:
app: demo-app
spec:
selector:
app: demo-app
ports:
- protocol: TCP
appProtocol: http
port: 5000