Issue with K6 Operator and Cloud NAT connection count during stress testing

33 Views Asked by At

I'm currently conducting stress testing using a GCP GKE private cluster with outbound traffic routed through Cloud NAT. I'm using the K6 Operator for stress testing.

Here's my testing script:

import http from 'k6/http';
import { check } from 'k6';

export let options = {
    stages: [
        { target: 300, duration: '5s' },
        { target: 500, duration: '120s' },
        { target: 600, duration: '600s' },
    ],
  noVUConnectionReuse: true,
  noConnectionReuse: true,
};

export default function () {
    const result = http.get('TARGET_URL:PORT');
    check(result, {
        'http response status code is 200': result.status === 200,
    });
}

And here's my K6 Operator YAML file:

apiVersion: k6.io/v1alpha1
kind: K6
metadata:
  name: k6-sample
spec:
  parallelism: 50
  script:
    configMap:
      name: "k6-sample-stress-test"
      file: "test.js"
  runner:
    image: ghcr.io/grafana/k6-operator:latest-runner
    resources:
      limits:
        cpu: 200m
        memory: 1000Mi
      requests:
        cpu: 100m
        memory: 500Mi
  arguments: --out influxdb=http://influxdb:8086/k6

When I start the stress testing, I observe via Cloud NAT monitoring that the connection count doesn't increase significantly, staying around 1 to 20 connections. However, when running the same script on a VM (with K6 installed), I notice the connection count goes up to 10-11k.

As I want to test the scalability of NAT IP and Port, I'm curious if there's a way to address this issue with the K6 Operator. Any insights or suggestions on how to resolve this would be greatly appreciated.

0

There are 0 best solutions below