diff --git a/README.md b/README.md index 8bfc235..31df809 100644 --- a/README.md +++ b/README.md @@ -76,19 +76,13 @@ make timoni-push Run the benchmark for OCI artifact pull and Flux Kustomization install: ```shell -KS=100 timoni bundle apply -f timoni/bundles/flux-kustomize-benchmark.cue --runtime-from-env --timeout=10m +KS=100 timoni bundle apply -f timoni/bundles/flux-benchmark.cue --runtime-from-env --timeout=10m ``` Run the benchmark for Flux Kustomization upgrade: ```shell -KS=100 MCPU=2 timoni bundle apply -f timoni/bundles/flux-kustomize-benchmark.cue --runtime-from-env --timeout=10m -``` - -Teardown: - -```shell -timoni bundle delete flux-kustomize-benchmark +KS=100 MCPU=2 timoni bundle apply -f timoni/bundles/flux-benchmark.cue --runtime-from-env --timeout=10m ``` ### Flux HelmRelease Benchmark @@ -96,19 +90,21 @@ timoni bundle delete flux-kustomize-benchmark Run the benchmark for Helm chart pull and Flux HelmRelease install: ```shell -HR=100 timoni bundle apply -f timoni/bundles/flux-helm-benchmark.cue --runtime-from-env --timeout=10m +HR=100 timoni bundle apply -f timoni/bundles/flux-benchmark.cue --runtime-from-env --timeout=10m ``` Run the benchmark for Flux HelmRelease upgrade: ```shell -HR=100 MCPU=2 timoni bundle apply -f timoni/bundles/flux-helm-benchmark.cue --runtime-from-env --timeout=10m +HR=100 MCPU=2 timoni bundle apply -f timoni/bundles/flux-benchmark.cue --runtime-from-env --timeout=10m ``` -Teardown: +### Teardown + +Remove all Flux resources and the benchmark namespaces with: ```shell -timoni bundle delete flux-helm-benchmark +timoni bundle delete flux-benchmark ``` ## MTTP Benchmark Results (Flux v2.2 RC) diff --git a/manifests/podinfo/podinfo.yaml b/manifests/podinfo/podinfo.yaml index 0fdb904..63e75ab 100644 --- a/manifests/podinfo/podinfo.yaml +++ b/manifests/podinfo/podinfo.yaml @@ -42,7 +42,7 @@ metadata: app.kubernetes.io/version: "6.5.3" app.kubernetes.io/managed-by: Flux spec: - replicas: 0 + replicas: ${PODS:=0} strategy: type: RollingUpdate rollingUpdate: diff --git a/timoni/bundles/flux-benchmark.cue b/timoni/bundles/flux-benchmark.cue new file mode 100644 index 0000000..7e52b99 --- /dev/null +++ b/timoni/bundles/flux-benchmark.cue @@ -0,0 +1,36 @@ +bundle: { + _ks: 0 @timoni(runtime:number:KS) + _hr: 0 @timoni(runtime:number:HR) + + apiVersion: "v1alpha1" + name: "flux-benchmark" + instances: { + if _ks > 0 { + "podinfo-ks": { + module: url: "oci://localhost:5555/modules/flux-ks-bench" + namespace: "kustomize-benchmark" + values: { + syncs: _ks + pods: 0 @timoni(runtime:number:PODS) + mcpu: 1 @timoni(runtime:number:MCPU) + } + } + } + if _hr > 0 { + "podinfo-hr": { + module: url: "oci://localhost:5555/modules/flux-hr-bench" + namespace: "helm-benchmark" + values: { + chart: { + name: "podinfo" + version: "6.5.3" + interval: 60 + } + releases: _hr + pods: 0 @timoni(runtime:number:PODS) + mcpu: 1 @timoni(runtime:number:MCPU) + } + } + } + } +} diff --git a/timoni/bundles/flux-helm-benchmark.cue b/timoni/bundles/flux-helm-benchmark.cue deleted file mode 100644 index c90b525..0000000 --- a/timoni/bundles/flux-helm-benchmark.cue +++ /dev/null @@ -1,22 +0,0 @@ -bundle: { - apiVersion: "v1alpha1" - name: "flux-helm-benchmark" - instances: { - "podinfo": { - module: url: "oci://localhost:5555/modules/flux-hr-bench" - namespace: "helm-benchmark" - values: { - chart: { - name: "podinfo" - version: "6.5.3" - interval: 60 - } - releases: 100 @timoni(runtime:number:HR) - replicas: 0 - requests: { - cpu: 1 @timoni(runtime:number:MCPU) - } - } - } - } -} diff --git a/timoni/bundles/flux-kustomize-benchmark.cue b/timoni/bundles/flux-kustomize-benchmark.cue deleted file mode 100644 index 6872066..0000000 --- a/timoni/bundles/flux-kustomize-benchmark.cue +++ /dev/null @@ -1,14 +0,0 @@ -bundle: { - apiVersion: "v1alpha1" - name: "flux-kustomize-benchmark" - instances: { - "podinfo": { - module: url: "oci://localhost:5555/modules/flux-ks-bench" - namespace: "kustomize-benchmark" - values: { - syncs: 1 @timoni(runtime:number:KS) - mcpu: 1 @timoni(runtime:number:MCPU) - } - } - } -} diff --git a/timoni/modules/flux-hr-bench/debug_values.cue b/timoni/modules/flux-hr-bench/debug_values.cue index 2b93ab5..aadee91 100644 --- a/timoni/modules/flux-hr-bench/debug_values.cue +++ b/timoni/modules/flux-hr-bench/debug_values.cue @@ -6,5 +6,4 @@ package main // Debug example 'cue cmd -t debug -t name=test -t namespace=test -t mv=1.0.0 -t kv=1.28.0 build'. values: { releases: 100 - replicas: 0 } diff --git a/timoni/modules/flux-hr-bench/templates/config.cue b/timoni/modules/flux-hr-bench/templates/config.cue index 9dcffa9..b27bfa3 100644 --- a/timoni/modules/flux-hr-bench/templates/config.cue +++ b/timoni/modules/flux-hr-bench/templates/config.cue @@ -34,8 +34,8 @@ import ( runTests: bool | *false releases: int | *1 - replicas: int | *2 - requests: cpu: int | *1 + pods: int | *1 + mcpu: int | *1 } // Instance takes the config values and outputs the Kubernetes objects. diff --git a/timoni/modules/flux-hr-bench/templates/helmrelease.cue b/timoni/modules/flux-hr-bench/templates/helmrelease.cue index ea1e82c..154566d 100644 --- a/timoni/modules/flux-hr-bench/templates/helmrelease.cue +++ b/timoni/modules/flux-hr-bench/templates/helmrelease.cue @@ -31,15 +31,15 @@ import ( } install: crds: "Create" upgrade: crds: "CreateReplace" - if _config.replicas > 0 { + if _config.pods > 0 { test: enable: _config.runTests } values: { - replicaCount: _config.replicas - if _config.replicas > 0 { + replicaCount: _config.pods + if _config.pods > 0 { hpa: { enabled: true - maxReplicas: _config.replicas + maxReplicas: _config.pods cpu: 99 } } @@ -49,7 +49,7 @@ import ( className: "nginx" } resources: requests: { - cpu: "\(_config.requests.cpu)m" + cpu: "\(_config.mcpu)m" memory: "16Mi" } } diff --git a/timoni/modules/flux-ks-bench/debug_values.cue b/timoni/modules/flux-ks-bench/debug_values.cue index 721e304..e98b3d1 100644 --- a/timoni/modules/flux-ks-bench/debug_values.cue +++ b/timoni/modules/flux-ks-bench/debug_values.cue @@ -5,5 +5,5 @@ package main // Values used by debug_tool.cue. // Debug example 'cue cmd -t debug -t name=test -t namespace=test -t mv=1.0.0 -t kv=1.28.0 build'. values: { - + syncs: 100 } diff --git a/timoni/modules/flux-ks-bench/templates/config.cue b/timoni/modules/flux-ks-bench/templates/config.cue index 41f2e51..0b4a42c 100644 --- a/timoni/modules/flux-ks-bench/templates/config.cue +++ b/timoni/modules/flux-ks-bench/templates/config.cue @@ -34,6 +34,7 @@ import ( } syncs: int | *1 + pods: int | *1 mcpu: int | *1 } diff --git a/timoni/modules/flux-ks-bench/templates/kustomization.cue b/timoni/modules/flux-ks-bench/templates/kustomization.cue index 2705971..a9667ce 100644 --- a/timoni/modules/flux-ks-bench/templates/kustomization.cue +++ b/timoni/modules/flux-ks-bench/templates/kustomization.cue @@ -29,6 +29,7 @@ import ( postBuild: substitute: { "INDEX": "\(_index)app" + "PODS": "\(_config.pods)" "MCPU": "\(_config.mcpu)m" }