1+ apiVersion : apps/v1
2+ kind : Deployment
3+ metadata :
4+ name : wasm-spin
5+ spec :
6+ replicas : 1
7+ selector :
8+ matchLabels :
9+ app : wasm-spin
10+ template :
11+ metadata :
12+ labels :
13+ app : wasm-spin
14+ spec :
15+ runtimeClassName : wasmtime-spin
16+ containers :
17+ - name : testwasm
18+ image : localhost:5000/spin-registry-push/spin-hello-world:latest
19+ imagePullPolicy : IfNotPresent
20+ command : ["/"]
21+ resources : # limit the resources to 128Mi of memory and 100m of CPU
22+ limits :
23+ cpu : 100m
24+ memory : 128Mi
25+ requests :
26+ cpu : 100m
27+ memory : 128Mi
28+ ---
29+ apiVersion : v1
30+ kind : Service
31+ metadata :
32+ name : wasm-spin
33+ spec :
34+ ports :
35+ - protocol : TCP
36+ port : 80
37+ targetPort : 80
38+ selector :
39+ app : wasm-spin
40+ ---
41+ apiVersion : apps/v1
42+ kind : Deployment
43+ metadata :
44+ name : spin-keyvalue
45+ spec :
46+ replicas : 1
47+ selector :
48+ matchLabels :
49+ app : spin-keyvalue
50+ template :
51+ metadata :
52+ labels :
53+ app : spin-keyvalue
54+ spec :
55+ runtimeClassName : wasmtime-spin
56+ containers :
57+ - name : keyvalue
58+ image : localhost:5000/spin-registry-push/spin-keyvalue:latest
59+ command : ["/"]
60+ imagePullPolicy : IfNotPresent
61+ volumeMounts :
62+ - name : config-volume
63+ mountPath : /runtime-config.toml
64+ subPath : runtime-config.toml
65+ readOnly : true
66+ volumes :
67+ - name : config-volume
68+ configMap :
69+ name : spin-runtime-config
70+ ---
71+ apiVersion : v1
72+ kind : Service
73+ metadata :
74+ name : spin-keyvalue
75+ spec :
76+ type : LoadBalancer
77+ ports :
78+ - protocol : TCP
79+ port : 80
80+ targetPort : 80
81+ selector :
82+ app : spin-keyvalue
83+ ---
84+ apiVersion : apps/v1
85+ kind : Deployment
86+ metadata :
87+ name : spin-outbound-redis
88+ spec :
89+ replicas : 1
90+ selector :
91+ matchLabels :
92+ app : spin-outbound-redis
93+ template :
94+ metadata :
95+ labels :
96+ app : spin-outbound-redis
97+ spec :
98+ runtimeClassName : wasmtime-spin
99+ containers :
100+ - name : outbound-redis
101+ image : localhost:5000/spin-registry-push/spin-outbound-redis:latest
102+ command : ["/"]
103+ imagePullPolicy : IfNotPresent
104+ env :
105+ - name : SPIN_VARIABLE_REDIS_ADDRESS
106+ value : redis://redis-service.default.svc.cluster.local:6379
107+ - name : SPIN_VARIABLE_REDIS_CHANNEL
108+ value : test
109+ ---
110+ apiVersion : v1
111+ kind : Service
112+ metadata :
113+ name : spin-outbound-redis
114+ spec :
115+ type : LoadBalancer
116+ ports :
117+ - protocol : TCP
118+ port : 80
119+ targetPort : 80
120+ selector :
121+ app : spin-outbound-redis
122+ ---
123+ # Middleware
124+ # Strip prefix /spin
125+ apiVersion : traefik.containo.us/v1alpha1
126+ kind : Middleware
127+ metadata :
128+ name : strip-prefix
129+ spec :
130+ stripPrefix :
131+ forceSlash : false
132+ prefixes :
133+ - /spin
134+ - /outboundredis
135+ - /keyvalue
136+ - /static-assets
137+ ---
138+ apiVersion : networking.k8s.io/v1
139+ kind : Ingress
140+ metadata :
141+ name : wasm-ingress
142+ annotations :
143+ ingress.kubernetes.io/ssl-redirect : " false"
144+ traefik.ingress.kubernetes.io/router.middlewares : default-strip-prefix@kubernetescrd
145+ spec :
146+ ingressClassName : traefik
147+ rules :
148+ - http :
149+ paths :
150+ - path : /spin
151+ pathType : Prefix
152+ backend :
153+ service :
154+ name : wasm-spin
155+ port :
156+ number : 80
157+ - path : /keyvalue
158+ pathType : Prefix
159+ backend :
160+ service :
161+ name : spin-keyvalue
162+ port :
163+ number : 80
164+ - path : /outboundredis
165+ pathType : Prefix
166+ backend :
167+ service :
168+ name : spin-outbound-redis
169+ port :
170+ number : 80
171+ - path : /multi-trigger-app
172+ pathType : Prefix
173+ backend :
174+ service :
175+ name : spin-multi-trigger-app
176+ port :
177+ number : 80
178+ - path : /static-assets
179+ pathType : Prefix
180+ backend :
181+ service :
182+ name : spin-static-assets
183+ port :
184+ number : 80
185+ ---
186+ apiVersion : apps/v1
187+ kind : Deployment
188+ metadata :
189+ name : spin-multi-trigger-app
190+ spec :
191+ replicas : 1
192+ selector :
193+ matchLabels :
194+ app : spin-multi-trigger-app
195+ template :
196+ metadata :
197+ labels :
198+ app : spin-multi-trigger-app
199+ spec :
200+ runtimeClassName : wasmtime-spin
201+ containers :
202+ - name : spin-multi-trigger-app
203+ image : localhost:5000/spin-registry-push/spin-multi-trigger-app:latest
204+ imagePullPolicy : IfNotPresent
205+ command : ["/"]
206+ ports :
207+ - containerPort : 80
208+ env :
209+ - name : SPIN_VARIABLE_REDIS_ADDRESS
210+ value : redis://redis-service.default.svc.cluster.local:6379
211+ - name : SPIN_VARIABLE_REDIS_CHANNEL
212+ value : testchannel
213+ ---
214+ apiVersion : v1
215+ kind : Service
216+ metadata :
217+ name : spin-multi-trigger-app
218+ spec :
219+ type : LoadBalancer
220+ ports :
221+ - protocol : TCP
222+ port : 80
223+ targetPort : 80
224+ selector :
225+ app : spin-multi-trigger-app
226+ ---
227+ apiVersion : apps/v1
228+ kind : Deployment
229+ metadata :
230+ name : spin-static-assets
231+ spec :
232+ replicas : 1
233+ selector :
234+ matchLabels :
235+ app : spin-static-assets
236+ template :
237+ metadata :
238+ labels :
239+ app : spin-static-assets
240+ spec :
241+ runtimeClassName : wasmtime-spin
242+ containers :
243+ - name : spin-static-assets
244+ image : localhost:5000/spin-registry-push/spin-static-assets:latest
245+ imagePullPolicy : IfNotPresent
246+ command : ["/"]
247+ ports :
248+ - containerPort : 80
249+ ---
250+ apiVersion : v1
251+ kind : Service
252+ metadata :
253+ name : spin-static-assets
254+ spec :
255+ type : LoadBalancer
256+ ports :
257+ - protocol : TCP
258+ port : 80
259+ targetPort : 80
260+ selector :
261+ app : spin-static-assets
262+ ---
263+ apiVersion : apps/v1
264+ kind : Deployment
265+ metadata :
266+ name : spin-mqtt-message-logger
267+ spec :
268+ replicas : 1
269+ selector :
270+ matchLabels :
271+ app : spin-mqtt-message-logger
272+ template :
273+ metadata :
274+ labels :
275+ app : spin-mqtt-message-logger
276+ spec :
277+ runtimeClassName : wasmtime-spin
278+ containers :
279+ - name : spin-mqtt-message-logger
280+ image : localhost:5000/spin-registry-push/spin-mqtt-message-logger:latest
281+ imagePullPolicy : IfNotPresent
282+ command : ["/"]
283+ ports :
284+ - containerPort : 80
285+ env :
286+ - name : SPIN_VARIABLE_MQTT_TOPIC
287+ value : containerd-shim-spin/mqtt-test-17h24d
288+ # The MQTT trigger cannot do DNS resolution, so we need to use the IP address of the MQTT broker
289+ - name : SPIN_VARIABLE_MQTT_BROKER_URI
290+ value : " mqtt://test.mosquitto.org"
291+ ---
292+ apiVersion : v1
293+ kind : Service
294+ metadata :
295+ name : spin-mqtt-message-logger
296+ spec :
297+ type : LoadBalancer
298+ ports :
299+ - protocol : TCP
300+ port : 80
301+ targetPort : 80
302+ selector :
303+ app : spin-mqtt-message-logger
0 commit comments