Skip to content

Commit

Permalink
kube-burner-ocp integration (#670)
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <rsevilla@redhat.com>
  • Loading branch information
rsevilla87 authored Jan 24, 2024
1 parent 581c54e commit ca3d9a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions workloads/kube-burner-ocp-wrapper/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Kube-burner

The `./run.sh` script is just a small wrapper on top of kube-burner to be used as entrypoint of some of its flags. The supported workloads are described in the [OpenShift OCP wrapper section](https://cloud-bulldozer.github.io/kube-burner/latest/ocp/) of the kube-burner docs.
The `./run.sh` script is just a small wrapper on top of kube-burner to be used as entrypoint of some of its flags. The supported workloads are described in the [kube-burner OCP wrapper docs](https://kube-burner.github.io/kube-burner-ocp/latest/).

In order to run a workload you have to set the `WORKLOAD` environment variable to one of the workloads supported by kube-burner. Example

```shell
$ ITERATIONS=5 WORKLOAD=cluster-density-v2 ./run.sh
/tmp/kube-burner ocp cluster-density-v2 --log-level=info --iterations=5 --churn=true --es-server=https://search-perfscale-dev-chmf5l4sh66lvxbnadi4bznl3a.us-west-2.es.amazonaws.com --es-index=ripsaw-kube-burner --qps=20 --burst=20
/tmp/kube-burner-ocp cluster-density-v2 --log-level=info --iterations=5 --churn=true --es-server=https://search-perfscale-dev-chmf5l4sh66lvxbnadi4bznl3a.us-west-2.es.amazonaws.com --es-index=ripsaw-kube-burner --qps=20 --burst=20
INFO[2023-03-13 16:39:57] 📁 Creating indexer: elastic
INFO[2023-03-13 16:39:59] 👽 Initializing prometheus client with URL: <truncated>
INFO[2023-03-13 16:40:00] 🔔 Initializing alert manager for prometheus: <truncated>
Expand All @@ -28,11 +28,11 @@ This wrapper supports some variables to tweak some basic parameters of the workl
- **ES_INDEX**: Defines the ElasticSearch/OpenSearch index name. By default `ripsaw-kube-burner`
- **QPS** and **BURST**: Defines client-go QPS and BURST parameters for kube-burner. 20 by default
- **GC**: Garbage collect created namespaces. true by default
- **EXTRA_FLAGS**: Extra flags that will be appended to the underlying kube-burner ocp command, by default empty.
- **EXTRA_FLAGS**: Extra flags that will be appended to the underlying kube-burner-ocp command, by default empty.

### Using the EXTRA_FLAGS variable

All the flags that can be appeneded through the `EXTRA_FLAGS` variable can be found in the [kube-burner docs](https://cloud-bulldozer.github.io/kube-burner/latest/ocp/)
All the flags that can be appeneded through the `EXTRA_FLAGS` variable can be found in the [kube-burner-ocp docs](https://kube-burner.github.io/kube-burner-ocp/latest/)
For example, we can tweak the churning behaviour of the cluster-density workload with:

```shell
Expand All @@ -54,11 +54,11 @@ $ EXTRA_FLAGS="--timeout=5h" ITERATIONS=500 WORKLOAD=cluster-density-v2 ./run.sh

## HyperShift

It's possible to use this script with HyperShift hosted clusters. The particularity of this is that kube-burner will grab metrics from different Prometheus endpoints:
It's possible to use this script with HyperShift hosted clusters. The particularity of this is that kube-burner-ocp will grab metrics from different Prometheus endpoints:

- Hosted control-plane stack or OBO: Hosted control-plane application metrics such as etcd, API latencies, etc.
- Management cluster stack: Hardware utilization metrics from its worker nodes and hosted control-plane pods.
- Hosted cluster stack: From this endpoint kube-burner collects data-plane metrics.
- Hosted cluster stack: From this endpoint kube-burner-ocp collects data-plane metrics.

In order to use it, the hosted cluster kubeconfig must be set upfront. These environment variables are also required:

Expand Down
10 changes: 5 additions & 5 deletions workloads/kube-burner-ocp-wrapper/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LOG_LEVEL=${LOG_LEVEL:-info}
if [ "$KUBE_BURNER_VERSION" = "default" ]; then
unset KUBE_BURNER_VERSION
fi
KUBE_BURNER_VERSION=${KUBE_BURNER_VERSION:-1.8.1}
KUBE_BURNER_VERSION=${KUBE_BURNER_VERSION:-1.0.0}
CHURN=${CHURN:-true}
WORKLOAD=${WORKLOAD:?}
QPS=${QPS:-20}
Expand All @@ -22,9 +22,9 @@ RETRY_DELAY=5
download_binary(){
local retries=0
while [ $retries -lt $MAX_RETRIES ]; do
KUBE_BURNER_URL="https://github.com/cloud-bulldozer/kube-burner/releases/download/v${KUBE_BURNER_VERSION}/kube-burner-V${KUBE_BURNER_VERSION}-linux-x86_64.tar.gz"
KUBE_BURNER_URL="https://github.com/kube-burner/kube-burner-ocp/releases/download/v${KUBE_BURNER_VERSION}/kube-burner-ocp-V${KUBE_BURNER_VERSION}-linux-x86_64.tar.gz"

if curl -sS -L "${KUBE_BURNER_URL}" | tar -xzC "${KUBE_DIR}/" kube-burner; then
if curl -sS -L "${KUBE_BURNER_URL}" | tar -xzC "${KUBE_DIR}/" kube-burner-ocp; then
echo "Download successful"
return 0
else
Expand Down Expand Up @@ -105,9 +105,9 @@ EOF

download_binary
if [[ ${WORKLOAD} =~ "index" ]]; then
cmd="${KUBE_DIR}/kube-burner index --uuid=${UUID} --start=$START_TIME --end=$((END_TIME+600)) --log-level ${LOG_LEVEL}"
cmd="${KUBE_DIR}/kube-burner-ocp index --uuid=${UUID} --start=$START_TIME --end=$((END_TIME+600)) --log-level ${LOG_LEVEL}"
else
cmd="${KUBE_DIR}/kube-burner ocp ${WORKLOAD} --log-level=${LOG_LEVEL} --qps=${QPS} --burst=${BURST} --gc=${GC} --uuid ${UUID}"
cmd="${KUBE_DIR}/kube-burner-ocp ${WORKLOAD} --log-level=${LOG_LEVEL} --qps=${QPS} --burst=${BURST} --gc=${GC} --uuid ${UUID}"
cmd+=" ${EXTRA_FLAGS}"
fi
if [[ ${WORKLOAD} =~ "cluster-density" ]]; then
Expand Down

0 comments on commit ca3d9a4

Please sign in to comment.