Run executable inside Azure Kubernetes Service Pod

4/12/2020

I want to use JMeter with OS Sampler for load testing. Jmeter is deployed on Azure Kubernetes Service(AKS). Can we run executable inside AKS Pod ( Jmeter slave container will execute that exe inside pod)?

Regards, Amit Agrawal

-- Amit Agrawal
azure-kubernetes
jmeter-5.0

2 Answers

4/21/2020

I found another way, copy executable and all its binaries in JMeter slave using follwing command.

 kubectl cp <source directory>  <jmeter-slave-podname>:/<target directory>

Provide all permission to target directory in jmeter slave pod.

-- Amit Agrawal
Source: StackOverflow

4/12/2020

you can run a second container in your pod using using the sidecar container approach.

https://kubernetes.io/docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume/#creating-a-pod-that-runs-two-containers

If your Os Sampler needs access to the PID of your main application running in the other Container, you will need to turn on ShareProcessNamespace

https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/

this will allow your JMETER exe to see the PID of the other process in the same POD.

Here's an repo with some master/slave manifest example forJMETER (note that it's not using the side-car container pattern)

https://github.com/kubernauts/jmeter-kubernetes

While this is viable and possible a working solution, assuming you are looking at the CPU/Memory metrics, you could also leverage the Prometheus stack with the node-exporter

https://github.com/helm/charts/tree/master/stable/prometheus-operator

This could remove the need for your JMETER setup if you are not allowing for specific Jmeter metrics

-- djsly
Source: StackOverflow