How to send the time series data generated using jmeter[Docker Container] script to influxdb[Not a Docker instance] in K8S

7/4/2019

Following is the Dockerfile of my jmeter container

FROM java:8-jdk

ARG JMETER_VERSION="3.3"
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
ENV JMETER_BIN  ${JMETER_HOME}/bin
ENV JMETER_DOWNLOAD_URL  https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz

# download and extract JMeter
RUN mkdir /tmp/dependencies
RUN curl -L --silent ${JMETER_DOWNLOAD_URL} > /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz

RUN tar -xzf /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz -C /opt && \
    rm -rf /tmp/dependencies

# Set global PATH such that "jmeter" command is found
ENV PATH $PATH:$JMETER_BIN

COPY plugins/lib/*.jar ${JMETER_HOME}/lib/
COPY plugins/lib/ext/*.jar ${JMETER_HOME}/lib/ext/
COPY jmeter.sh ${JMETER_HOME}/bin/

COPY entrypoint.sh /

WORKDIR ${JMETER_HOME}

ENTRYPOINT ["/entrypoint.sh"]

I trigger the build via Jenkins where I have parameterized the scenarios, environment, threads etc.

My script has influxdb endpoints where the time series data will be sent which will be later showed in grafana.

It worked well when I had set up following docker container services locally ,individually and creating a network of it.

  • Jenkins
  • Jmeter
  • InfluxDB
  • Grafana

Now, in real-world I have to deal with only one Docker container Jmeter. At this point in time, I am not sure how can I do volume mapping with Jmeter container and InfluxDB which is not the container but aws instance. How will I send the data to it?

Help would be gladly appreciated. Thank you

-- Manoj Kengudelu
docker
influxdb
jmeter
kubernetes
performance-testing

2 Answers

7/4/2019

You can use telegraf

https://www.influxdata.com/time-series-platform/telegraf/

it offers you a variety of input plugins you can combine from different sources and integrations

https://www.influxdata.com/products/integrations/

-- wolmi
Source: StackOverflow

7/5/2019
Now, in real-world I have to deal with only one Docker container Jmeter

based on this assumption, the only thing that actually changes from your container's perspective is the endpoint of InfluxDB, which is still configurable*.

In K8S world, if you want to access services living outside of the cluster (e.g. InfluxDB running on AWS instance) you need to map them to the cluster network via concept of Service without the selectors.

* endpoint from the link I shared would have a name 'my-service:80' (yes, that's it)

-- Nepomucen
Source: StackOverflow