Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 006c101

Browse files
authored
fix workload to run with traefik in k3d (#12)
1 parent 87a30d9 commit 006c101

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

deployments/k3d/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build-image: move-musl-to-tmp
1212
docker build -t $(IMAGE_NAME) .
1313

1414
up: build-image
15-
k3d cluster create $(CLUSTER_NAME) --image $(IMAGE_NAME) --api-port 6550 -p "8081:80@loadbalancer"
15+
k3d cluster create $(CLUSTER_NAME) --image $(IMAGE_NAME) --api-port 6550 -p "8081:80@loadbalancer" --agents 2
1616

1717
deploy:
1818
kubectl apply -f ../workloads

deployments/k3d/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $ tree .
1717
## How to run the example
1818
The shell script below will create a k3d cluster locally with the Wasm shims installed and containerd configured. The script then applies the runtime classes for the shims and an example service and deployment. Finally, we curl the `/hello` and receive a response from the example workload.
1919
```shell
20-
k3d cluster create wasm-cluster --image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:latest --api-port 6550 -p "8081:80@loadbalancer"
20+
k3d cluster create wasm-cluster --image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:latest -p "8081:80@loadbalancer" --agents 2
2121
kubectl apply -f https://github.com/deislabs/containerd-wasm-shims/releases/download/v0.2.0/runtime.yaml
2222
kubectl apply -f https://github.com/deislabs/containerd-wasm-shims/releases/download/v0.2.0/workload.yaml
2323
curl -v http://0.0.0.0:8081/hello

deployments/workloads/workload.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Deployment
33
metadata:
44
name: wasm-spin
55
spec:
6-
replicas: 1
6+
replicas: 3
77
selector:
88
matchLabels:
99
app: wasm-spin
@@ -21,12 +21,31 @@ spec:
2121
apiVersion: v1
2222
kind: Service
2323
metadata:
24-
name: wasm-service
24+
name: wasm-spin
2525
spec:
2626
type: LoadBalancer
2727
ports:
2828
- protocol: TCP
2929
port: 80
3030
targetPort: 80
3131
selector:
32-
app: wasm-spin
32+
app: wasm-spin
33+
---
34+
apiVersion: networking.k8s.io/v1
35+
kind: Ingress
36+
metadata:
37+
name: wasm-spin
38+
annotations:
39+
ingress.kubernetes.io/ssl-redirect: "false"
40+
kubernetes.io/ingress.class: traefik
41+
spec:
42+
rules:
43+
- http:
44+
paths:
45+
- path: /
46+
pathType: Prefix
47+
backend:
48+
service:
49+
name: wasm-spin
50+
port:
51+
number: 80

0 commit comments

Comments
 (0)