k6 error when trying to send data to InfluxDB in the Cluster

69 Views Asked by At

I sh file that executes a performance test in the Cluster k8s but when I execute the Pod appears a message: level=error msg="Couldn't write stats" error="Action: Deny. Reason: No rule matched. Proceeding with default action." output=InfluxDBv1

SH file:

apt install gpg -y
gpg -k
gpg --no-default-keyring --keyring /usr/share/keyrings/xk6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb [signed-by=/usr/share/keyrings/xk6-archive-keyring.gpg] https://dl.xk6.io/deb stable main" |  tee /etc/apt/sources.list.d/xk6.list
apt-get update
apt-get install xk6
k6 run --out influxdb=http://influxdb-k6.monitor.svc.cluster.local ./non-functional-testing/createOrganization.js

I received a response from someone on devoPs teams and he told me this error occurs when k6 is invoked as this is InfluxDB2, which according to the documentation k6 is incompatible with.

So, I have try to add this to the sh file:


sudo apt update
sudo apt upgrade
sudo apt search golang-go
sudo apt search gccgo-go
sudo apt install golang-go
go install go.k6.io/xk6/cmd/xk6@latest

# Clone the xk6-disruptor code
git clone https://github.com/grafana/xk6-disruptor.git
cd xk6-disruptor

# Build the custom binary 
xk6 build --output xk6-disruptor --with github.com/grafana/xk6-disruptor=.

k6 run --out influxdb=http://influxdb-k6.monitor.svc.cluster.local ./non-functional-testing/createOrganization.js

as mentioned in the k6 documentation but then I get a response in the logs that SUdo is not recognized. Does someone have a way to install xk6 in the sh file using linux?

1

There are 1 best solutions below

0
knittl On

Your container is already running as root, there's no need to call sudo:

apt update
apt upgrade
...