"nodeSelector" not working in K6 Operator

Hey everyone,

I’m trying to use K6 operator to run a distributed load test on AWS. I want all of the runners to run on separate nodes of a specific node group in my EKS cluster. I’ve tried to setup a nodeSelector but I’m getting the following error.

error validating data: ValidationError(K6.spec.runner): unknown field "nodeSelector" in io.k6.v1alpha1.K6.spec.runner

Is it not possible to use nodeSelector? Here’s what my CRD looks like:

apiVersion: k6.io/v1alpha1
kind: K6
metadata:
  name: k6-edamame-test
spec:
  parallelism: 4
  script:
    configMap:
      name: '18'
      file: test1.js
  separate: true
  arguments: '--out distributed-statsd'
  runner:
    image: lukeoguro/xk6-statsd:latest
    env:
      - name: K6_STATSD_ADDR
        value: statsd-service:8125
      - name: POD_NAME
        valueFrom:
          fieldRef:
            fieldPath: metadata.name
      - name: K6_STATSD_GAUGE_NAMESPACE
        value: $(POD_NAME).
      - name: K6_STATSD_NAMESPACE
        value: '18.'
    nodeSelector:
      alpha.eksctl.io/nodegroup-name: load-generators

Any help would be appreciated!

Hi @elguaposalsero

Thanks for raising this questions. I am reproducing the same, I can’t use the nodeSelector, which was introduced in Add nodeSelectors and/or nodeAffinity/anti-affinity · Issue #8 · grafana/k6-operator · GitHub. I’m reaching out to the developers for help, as I’m not sure if I’m missing anything. We’ll update here.

Cheers!

Hi @elguaposalsero, by definition of K6 CRD nodeselector should be specified without camel case:

runner:
   nodeselector: 
      role: k6-operator

Now that I look at it, it can be considered bad UX given Kubernetes “official” APIs :sweat_smile: Perhaps, we should change it to nodeSelector to avoid such confusion in the future…
Thanks for pointing it out!

2 Likes

Hi @elguaposalsero

@olha created this issue Rename CRD fields to have standard naming · Issue #206 · grafana/k6-operator · GitHub to rename the nodeselector field to nodeSelector.

Many thanks for raising this!