Performance and Scale test K8s platform using kube-burner
Kube-burner is an orchestration tool for performing scale and performance tests. It provides following features:
- Create, delete and patch Kubernetes resources at scale
- Prometheus metric collection and indexing
- Measurements
- Alerting
Latest binaries for kube-burner
Depending on the use case you wish to benchmark against, we are able to execute specific workloads. The configuration file for kube-burner contains a description of all of its magic. As was already indicated, the flag -c specifies where this configuration file is located. This indicator links to a multi-sectioned file in YAML format.
Within this configuration file, go-template semantics are usable. Notably, all environment variables are provided to this template, allowing us to reference them with the notation {{.ENV_VAR}}.
Indexing
By default, the metrics from the pod and service latency measurements are sent to every indexer set up in the metricsEndpoints list.
For example
metricsEndpoints:
- indexer:
type: local
metricsDirectory: {{ .METRICS_FOLDER }}
- indexer:
type: opensearch
defaultIndex: kube-burner
esServers: ["https://opensearch.domain:9200"]
alias: os-indexer
global:
measurements:
- name: podLatency
The measurement podLatency would employ both local and opensearch indexer with the setup snippet above.
Global
global:
measurements:
- name: podLatency
gc: true
waitWhenFinished: true
clusterHealth: true
kube-burner connects k8s clusters in following precedence:-
KUBECONFIG
environment variable > $HOME/.kube/config >
In-cluster config (when kube-burner runs inside a pod)
measurements
Support podLatency, serviceLatency and pprof
gc
Cleanup created namespaces
waitWhenFinished
Wait for all pods/jobs (including probes) to be running/completed when all jobs are completed
clusterHealth
Checks if all the nodes are in "Ready" state
Jobs
It contains the list of jobs kube-burner
will execute
jobs:
- name: <job-name>
jobIterations: 100
qps: 10
burst: 20
preLoadImages: false
namespacedIterations: true
namespace: <namespace-base-name>
waitWhenFinished: true
podWait: false
objects:
- objectTemplate: deployment.yml
replicas: 1
- objectTemplate: configmap.yaml
replicas: 1
- objectTemplate: service.yml
replicas: 1
name
Job name
jobIterations
How many times to execute the job
qps
Limit object creation queries per second
burst
Maximum burst for throttle
preLoadImages
Kube-burner will create a DS before triggering the job to pull all the images of the job
namespacedIterations
Whether to create a namespace per job iteration
namespace
Namespace base name to use
waitWhenFinished
Wait for all pods/jobs (including probes) to be running/completed when all job iterations are completed
podWait
Wait for all pods/jobs (including probes) to be running/completed before moving forward to the next job iteration
objects
List of objects the job will create. Detailed on the objects section
Objects
The golang template library by default is used to render the objects generated by kube-burner.
objects:
- objectTemplate: deployment.yml
replicas: 3
waitOptions:
kind: Pod
labelSelector: {kube-burner-label : abcd}
forCondition: Ready
objectTemplate
Object template file path or URL
replicas
How replicas of this object to create per job iteration
waitOptions
Customize how to wait for object to be ready
kind
Object kind to consider for wait
labelSelector
Objects with these labels will be considered for wait
forCondition
Wait for the object condition with this name to be true
jobConfig.yml
metricsEndpoints:
- indexer:
type: local
metricsDirectory: {{ .METRICS_FOLDER }}
- indexer:
type: opensearch
defaultIndex: kube-burner
esServers: ["https://opensearch.domain:9200"]
alias: os-indexer
global:
measurements:
- name: podLatency
gc: true
waitWhenFinished: true
clusterHealth: true
jobs:
- name: <job-name>
jobIterations: 100
qps: 10
burst: 20
preLoadImages: false
namespacedIterations: true
namespace: <namespace-base-name>
waitWhenFinished: true
podWait: false
objects:
- objectTemplate: deployment.yml
replicas: 3
waitOptions:
kind: Pod
labelSelector: {kube-burner-label : abcd}
forCondition: Ready
Running Kube-burner tests
kube-burner init -c jobConfig.yml