forked from wasmCloud/wasmCloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwadm.yaml
56 lines (55 loc) · 2.11 KB
/
wadm.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
# This is a full example of how to run the kvcounter component exposed with an HTTP server.
#
# Using this example requires you to have a Redis server running locally
# (though the linkdef can be modified to use a Redis server you have running elsewhere).
#
# You also need to have WADM running:
# https://github.com/wasmCloud/wadm/tree/main/wadm.
#
# You can deploy this example with a simple command:
# `wash app deploy wadm.yaml`
---
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: http-echo-tinygo-component
annotations:
version: v0.0.1
description: 'HTTP Echo demo in Golang (TinyGo), using the WebAssembly Component Model and WebAssembly Interfaces Types (WIT)'
wasmcloud.dev/authors: wasmCloud team
wasmcloud.dev/source-url: https://github.com/wasmCloud/wasmCloud/blob/main/examples/golang/components/http-echo-tinygo/wadm.yaml
wasmcloud.dev/readme-md-url: https://github.com/wasmCloud/wasmCloud/blob/main/examples/golang/components/http-echo-tinygo/README.md
wasmcloud.dev/homepage: https://github.com/wasmCloud/wasmCloud/tree/main/examples/golang/components/http-echo-tinygo
wasmcloud.dev/categories: |
http,outgoing-http,http-server,golang,tinygo,example,golang
spec:
components:
- name: http-echo-tinygo
type: component
properties:
image: file://./build/http-echo-tinygo-component_s.wasm
traits:
# Govern the spread/scheduling of the component
- type: spreadscaler
properties:
instances: 1
# Add a capability provider that mediates HTTP access
- name: httpserver
type: capability
properties:
image: ghcr.io/wasmcloud/http-server:0.25.0
traits:
# Link to Echo, and inform it to listen on port 8000
# on the local machine
- type: link
properties:
target:
name: http-echo-tinygo
namespace: wasi
package: http
interfaces: [incoming-handler]
source:
config:
- name: default-http
properties:
address: "0.0.0.0:8000"