forked from spinkube/containerd-shim-spin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
- Loading branch information
1 parent
e9bb770
commit aade889
Showing
5 changed files
with
283 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-redis-config | ||
data: | ||
redis-config: | | ||
maxmemory 2mb | ||
maxmemory-policy allkeys-lru |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: redis | ||
labels: | ||
name: redis | ||
spec: | ||
containers: | ||
- name: redis | ||
image: redis:5.0.4 | ||
command: | ||
- redis-server | ||
- "/redis-master/redis.conf" | ||
env: | ||
- name: MASTER | ||
value: "true" | ||
ports: | ||
- containerPort: 6379 | ||
resources: | ||
limits: | ||
cpu: "0.1" | ||
volumeMounts: | ||
- mountPath: /redis-master-data | ||
name: data | ||
- mountPath: /redis-master | ||
name: config | ||
volumes: | ||
- name: data | ||
emptyDir: {} | ||
- name: config | ||
configMap: | ||
name: test-redis-config | ||
items: | ||
- key: redis-config | ||
path: redis.conf | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: redis-service | ||
spec: | ||
selector: | ||
name: redis | ||
ports: | ||
- protocol: TCP | ||
port: 6379 | ||
targetPort: 6379 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: node.k8s.io/v1 | ||
kind: RuntimeClass | ||
metadata: | ||
name: wasmtime-spin | ||
handler: spin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
data: | ||
runtime-config.toml: "# This defines a new store named user_data\n[key_value_store.foo]\ntype | ||
= \"spin\" \npath = \"user_data.db\"" | ||
kind: ConfigMap | ||
metadata: | ||
creationTimestamp: "2023-11-14T00:41:01Z" | ||
name: spin-runtime-config | ||
namespace: default | ||
resourceVersion: "4453" | ||
uid: 10dd6b0d-cf71-4ddc-abf8-44853f53436e |
212 changes: 212 additions & 0 deletions
212
tests/workloads-spin-registry-push/workload-spin-registry-push.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,212 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: wasm-spin | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: wasm-spin | ||
template: | ||
metadata: | ||
labels: | ||
app: wasm-spin | ||
spec: | ||
runtimeClassName: wasmtime-spin | ||
containers: | ||
- name: testwasm | ||
image: test-registry:5000/spin-registry-push/spin-hello-world:latest | ||
imagePullPolicy: IfNotPresent | ||
command: ["/"] | ||
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-spin | ||
spec: | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
selector: | ||
app: wasm-spin | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: spin-keyvalue | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: spin-keyvalue | ||
template: | ||
metadata: | ||
labels: | ||
app: spin-keyvalue | ||
spec: | ||
runtimeClassName: wasmtime-spin | ||
containers: | ||
- name: keyvalue | ||
image: test-registry:5000/spin-registry-push/spin-keyvalue:latest | ||
command: ["/"] | ||
imagePullPolicy: IfNotPresent | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /runtime-config.toml | ||
subPath: runtime-config.toml | ||
readOnly: true | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: spin-runtime-config | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: spin-keyvalue | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
selector: | ||
app: spin-keyvalue | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: spin-outbound-redis | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: spin-outbound-redis | ||
template: | ||
metadata: | ||
labels: | ||
app: spin-outbound-redis | ||
spec: | ||
runtimeClassName: wasmtime-spin | ||
containers: | ||
- name: outbound-redis | ||
image: test-registry:5000/spin-registry-push/spin-outbound-redis:latest | ||
command: ["/"] | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: SPIN_VARIABLE_REDIS_ADDRESS | ||
value: redis://redis-service.default.svc.cluster.local:6379 | ||
- name: SPIN_VARIABLE_REDIS_CHANNEL | ||
value: test | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: spin-outbound-redis | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
selector: | ||
app: spin-outbound-redis | ||
--- | ||
# Middleware | ||
# Strip prefix /spin | ||
apiVersion: traefik.containo.us/v1alpha1 | ||
kind: Middleware | ||
metadata: | ||
name: strip-prefix | ||
spec: | ||
stripPrefix: | ||
forceSlash: false | ||
prefixes: | ||
- /spin | ||
- /outboundredis | ||
- /keyvalue | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: wasm-ingress | ||
annotations: | ||
ingress.kubernetes.io/ssl-redirect: "false" | ||
traefik.ingress.kubernetes.io/router.middlewares: default-strip-prefix@kubernetescrd | ||
spec: | ||
ingressClassName: traefik | ||
rules: | ||
- http: | ||
paths: | ||
- path: /spin | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: wasm-spin | ||
port: | ||
number: 80 | ||
- path: /keyvalue | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: spin-keyvalue | ||
port: | ||
number: 80 | ||
- path: /outboundredis | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: spin-outbound-redis | ||
port: | ||
number: 80 | ||
- path: /multi-trigger-app | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: spin-multi-trigger-app | ||
port: | ||
number: 80 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: spin-multi-trigger-app | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: spin-multi-trigger-app | ||
template: | ||
metadata: | ||
labels: | ||
app: spin-multi-trigger-app | ||
spec: | ||
runtimeClassName: wasmtime-spin | ||
containers: | ||
- name: spin-multi-trigger-app | ||
image: test-registry:5000/spin-registry-push/spin-multi-trigger-app:latest | ||
imagePullPolicy: IfNotPresent | ||
command: ["/"] | ||
ports: | ||
- containerPort: 80 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: spin-multi-trigger-app | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
selector: | ||
app: spin-multi-trigger-app |