Skip to content

Commit

Permalink
add the missing lunatic workload to deployemnts/workloads (#144)
Browse files Browse the repository at this point in the history
Signed-off-by: jiaxiao zhou <[email protected]>
  • Loading branch information
Mossaka authored Sep 3, 2023
1 parent a0cccaf commit add96b0
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deployments/k3d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ k3d cluster create wasm-cluster --image ghcr.io/deislabs/containerd-wasm-shims/e
kubectl apply -f https://github.com/deislabs/containerd-wasm-shims/raw/main/deployments/workloads/runtime.yaml
kubectl apply -f https://github.com/deislabs/containerd-wasm-shims/raw/main/deployments/workloads/workload.yaml
echo "waiting 5 seconds for workload to be ready"
sleep 5
sleep 15
curl -v http://127.0.0.1:8081/spin/hello
curl -v http://127.0.0.1:8081/slight/hello
curl -v http://127.0.0.1:8081/wws/hello
Expand Down
8 changes: 7 additions & 1 deletion deployments/workloads/runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: wasmtime-wws
handler: wws
handler: wws
---
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: wasmtime-lunatic
handler: lunatic
46 changes: 46 additions & 0 deletions deployments/workloads/workload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,44 @@ spec:
selector:
app: wasm-wws
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wasm-lunatic
spec:
replicas: 1
selector:
matchLabels:
app: wasm-lunatic
template:
metadata:
labels:
app: wasm-lunatic
spec:
runtimeClassName: wasmtime-lunatic
containers:
- name: lunatic
image: ghcr.io/deislabs/containerd-wasm-shims/examples/lunatic-submillisecond:v0.9.0
resources: # limit the resources to 128Mi of memory and 100m of CPU
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
name: wasm-lunatic
spec:
ports:
- protocol: TCP
port: 80
targetPort: 3000
selector:
app: wasm-lunatic
---
# Middleware
# Strip prefix /spin
apiVersion: traefik.containo.us/v1alpha1
Expand All @@ -128,6 +166,7 @@ spec:
- /spin
- /slight
- /wws
- /lunatic
---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down Expand Up @@ -160,5 +199,12 @@ spec:
backend:
service:
name: wasm-wws
port:
number: 80
- path: /lunatic
pathType: Prefix
backend:
service:
name: wasm-lunatic
port:
number: 80

0 comments on commit add96b0

Please sign in to comment.