1
+ apiVersion : v1
2
+ kind : ConfigMap
3
+ metadata :
4
+ name : layotto-runtime-config
5
+ data :
6
+ config.json : |
7
+ {
8
+ "servers": [
9
+ {
10
+ "default_log_path": "stdout",
11
+ "default_log_level": "DEBUG",
12
+ "routers": [
13
+ {
14
+ "router_config_name": "actuator_dont_need_router"
15
+ }
16
+ ],
17
+ "listeners": [
18
+ {
19
+ "name": "grpc",
20
+ "address": "0.0.0.0:34904",
21
+ "bind_port": true,
22
+ "filter_chains": [
23
+ {
24
+ "filters": [
25
+ {
26
+ "type": "grpc",
27
+ "config": {
28
+ "server_name": "runtime",
29
+ "grpc_config": {
30
+ "hellos": {
31
+ "quick_start_demo": {
32
+ "type": "helloworld",
33
+ "hello": "greeting"
34
+ }
35
+ },
36
+ "state": {
37
+ "state_demo": {
38
+ "type": "in-memory",
39
+ "metadata": {
40
+ }
41
+ }
42
+ },
43
+ "lock": {
44
+ "lock_demo": {
45
+ "type": "in-memory",
46
+ "metadata": {
47
+ }
48
+ }
49
+ },
50
+ "pub_subs": {
51
+ "pub_subs_demo": {
52
+ "type": "in-memory",
53
+ "metadata": {
54
+ "consumerID": "1"
55
+ }
56
+ }
57
+ },
58
+ "sequencer": {
59
+ "sequencer_demo": {
60
+ "type": "in-memory",
61
+ "metadata": {}
62
+ }
63
+ },
64
+ "secret_store": {
65
+ "secret_demo": {
66
+ "type": "local.env",
67
+ "metadata": {
68
+ }
69
+ }
70
+ },
71
+ "bindings": {
72
+ "bindings_demo": {
73
+ "type": "http",
74
+ "metadata": {
75
+ "url": "https://mosn.io/layotto"
76
+ }
77
+ }
78
+ },
79
+ "custom_component": {
80
+ "helloworld": {
81
+ "demo": {
82
+ "type": "in-memory",
83
+ "metadata": {}
84
+ }
85
+ }
86
+ },
87
+ "app": {
88
+ "app_id": "app1",
89
+ "grpc_callback_port": 9999
90
+ }
91
+ }
92
+ }
93
+ }
94
+ ]
95
+ }
96
+ ]
97
+ },
98
+ {
99
+ "name": "actuator",
100
+ "address": "127.0.0.1:34999",
101
+ "bind_port": true,
102
+ "filter_chains": [
103
+ {
104
+ "filters": [
105
+ {
106
+ "type": "proxy",
107
+ "config": {
108
+ "downstream_protocol": "Http1",
109
+ "upstream_protocol": "Http1",
110
+ "router_config_name": "actuator_dont_need_router"
111
+ }
112
+ }
113
+ ]
114
+ }
115
+ ],
116
+ "stream_filters": [
117
+ {
118
+ "type": "actuator_filter"
119
+ }
120
+ ]
121
+ }
122
+ ]
123
+ }
124
+ ],
125
+ "tracing": {
126
+ "enable": true,
127
+ "driver": "SOFATracer",
128
+ "config": {
129
+ "generator": "mosntracing",
130
+ "exporter": [
131
+ "stdout"
132
+ ]
133
+ }
134
+ },
135
+ "metrics": {
136
+ "sinks": [
137
+ {
138
+ "type": "prometheus",
139
+ "config": {
140
+ "port": 34903
141
+ }
142
+ }
143
+ ]
144
+ }
145
+ }
146
+
147
+ ---
148
+
149
+ apiVersion : apps/v1
150
+ kind : Deployment
151
+ metadata :
152
+ name : counter-deployment
153
+ labels :
154
+ app : counter-deployment
155
+ spec :
156
+ selector :
157
+ matchLabels :
158
+ app : counter
159
+ replicas : 1
160
+ template :
161
+ metadata :
162
+ labels :
163
+ app : counter
164
+ spec :
165
+ containers :
166
+ # Your app
167
+ - name : count
168
+ image : busybox:1.28
169
+ args : [ /bin/sh, -c,
170
+ ' i=0; while true; do echo "$i: $(date)"; i=$((i+1)); sleep 1; done' ]
171
+ # Layotto
172
+ - name : layotto-runtime
173
+ image : layotto/layotto:latest
174
+ command : [ "/runtime/layotto", "start" ]
175
+ args : [ "-c", "/runtime/configs/config.json" ]
176
+ ports :
177
+ - containerPort : 34904
178
+ volumeMounts :
179
+ - name : runtime-config
180
+ mountPath : /runtime/configs
181
+ readOnly : false
182
+ volumes :
183
+ - name : runtime-config
184
+ configMap :
185
+ name : layotto-runtime-config
186
+ items :
187
+ - key : config.json
188
+ path : config.json
0 commit comments