Skip to content

Commit

Permalink
chore: moar kubernetes
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Fontes <[email protected]>
  • Loading branch information
lxfontes committed Nov 14, 2024
1 parent 926dd66 commit 57c77f1
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 21 deletions.
2 changes: 1 addition & 1 deletion _examples/k8s/blaster-component-wadm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ spec:
traits:
- type: spreadscaler
properties:
replicas: 100
replicas: 1000
2 changes: 1 addition & 1 deletion _examples/k8s/blaster-component-wasmtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: wasmtime
spec:
replicas: 3
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: wasmtime
Expand Down
2 changes: 1 addition & 1 deletion _examples/k8s/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace: k6

resources:
- wasmcloud-test.yaml
- wasmtime-test.yaml
#- wasmtime-test.yaml
- blaster-component-wasmtime.yaml

configMapGenerator:
Expand Down
31 changes: 22 additions & 9 deletions _examples/k8s/wasmcloud-test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
import wrpc from "k6/x/wrpc";
import http from "k6/http";

export const options = {
scenarios: {
blaster: {
executor: "constant-vus",
vus: 10,
vus: 100,
duration: "15m",
exec: "wrpcBlaster",
},
// http: {
// executor: "constant-vus",
// vus: 10,
// duration: "15m",
// exec: "httpBlaster",
// },
wrpchttp: {
executor: "constant-vus",
vus: 100,
duration: "15m",
startTime: "15m",
exec: "wrpcHttpBlaster",
},
http: {
executor: "constant-vus",
vus: 100,
duration: "15m",
startTime: "30m",
exec: "httpBlaster",
},
},
};

Expand All @@ -24,7 +33,7 @@ let blaster = wrpc.blaster({
},
});

let http = wrpc.http({
let wrpcHttp = wrpc.http({
nats: {
url: "nats://nats-headless.default.svc.cluster.local:4222",
prefix: "default.rust_hello_world-http_component",
Expand All @@ -35,6 +44,10 @@ export function wrpcBlaster() {
blaster.blast();
}

export function wrpcHttpBlaster() {
wrpcHttp.get("http://localhost:8080/");
}

export function httpBlaster() {
http.get("http://localhost:8080/");
http.get("http://wasmcloud-http-headless.default.svc.cluster.local:8080/");
}
6 changes: 4 additions & 2 deletions _examples/k8s/wasmcloud-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ kind: TestRun
metadata:
name: wasmcloud
spec:
parallelism: 5
parallelism: 4
# pod anti-affinity
separate: true
# separate: true
arguments: "--tag test-id=wasmcloud -o experimental-opentelemetry"
runner:
image: ghcr.io/cosmonic-labs/xk6-wrpc:main
imagePullPolicy: Always
# nodeSelector:
# cloud.google.com/compute-class: Scale-Out
env:
- name: K6_OTEL_GRPC_EXPORTER_INSECURE
value: "true"
Expand Down
11 changes: 6 additions & 5 deletions _examples/k8s/wasmtime-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ export const options = {
scenarios: {
blaster: {
executor: "constant-vus",
vus: 10,
vus: 50,
duration: "15m",
exec: "wrpcBlaster",
},
// http: {
// executor: "constant-vus",
// vus: 10,
// duration: "15m",
// exec: "httpBlaster",
// startTime: "15m",
// exec: "wrpcHttpBlaster",
// },
},
};
Expand All @@ -24,7 +25,7 @@ let blaster = wrpc.blaster({
},
});

let http = wrpc.http({
let wrpcHttp = wrpc.http({
nats: {
url: "nats://nats-headless.default.svc.cluster.local:4222",
prefix: "wasmtime",
Expand All @@ -35,6 +36,6 @@ export function wrpcBlaster() {
blaster.blast();
}

export function httpBlaster() {
http.get("http://localhost:8080/");
export function wrpcHttpBlaster() {
wrpcHttp.get("http://localhost:8080/");
}
20 changes: 18 additions & 2 deletions _examples/k8s/wasmtime-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,36 @@ kind: TestRun
metadata:
name: wasmtime
spec:
parallelism: 5
parallelism: 2
# pod anti-affinity
separate: true
# separate: true
arguments: "--tag test-id=wasmtime -o experimental-opentelemetry"
runner:
image: ghcr.io/cosmonic-labs/xk6-wrpc:main
imagePullPolicy: Always
# nodeSelector:
# cloud.google.com/compute-class: Scale-Out
resources:
requests:
memory: "1Gi"
cpu: "1"
limits:
cpu: "1"
env:
- name: K6_OTEL_GRPC_EXPORTER_INSECURE
value: "true"
- name: K6_OTEL_GRPC_EXPORTER_ENDPOINT
value: "otel-collector-headless.default.svc.loadtesting:4317"
- name: K6_OTEL_METRIC_PREFIX
value: "k6_"
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
- name: GOMAXPROCS
valueFrom:
resourceFieldRef:
resource: limits.cpu
script:
configMap:
name: tests
Expand Down

0 comments on commit 57c77f1

Please sign in to comment.