Skip to content

Sidecar containers in 0.23 are not working #636

@sahilsk

Description

@sahilsk

Brief summary

Hi,
In 0.0.22 sidecar containers were introduced.

I tried to use them so that my runners sidecar containers can send generated reports to s3 bucket .

But to my surprise they are not working.

k6-operator version or image

0.0.23

Helm chart version (if applicable)

helm-k6-operator-3.16.0

TestRun / PrivateLoadZone YAML

---
apiVersion: k6.io/v1alpha1
kind: TestRun
metadata:
  name: ad2f79e1-testrun
  namespace: ops
spec:
  parallelism: 4
  script:
    configMap:
      name: ad2f79e1-loadscript
      file: script.js
  arguments: --vus 200 --duration 300s --max-redirects 10 --batch 20 --batch-per-host 6 --user-agent Teload_Grafana_K6/1.2.1 --tag testid=ad2f79e1-579c-43ec-b173-61bcafc4fdb0 --tag teamname=unknown --include-system-env-vars --summary-mode compact --out experimental-prometheus-rw --out dashboard=export=/data/ad2f79e1.html&period=2s --out json=/data/ad2f79e1.json
  runner:
    initContainers:
      - name: foo-sidecar
        image: busybox:1.28
        restartPolicy: Always
        command: ['sh','-c','while true; do ls -alh /data/; sleep 1; done']
        workingDir: /data
        volumeMounts:
          - mountPath: /data
            name: k6-provision-location
    metadata:
      annotations:
        sidecar.istio.io/inject: "false"
        testid: ad2f79e1-579c-43ec-b173-61bcafc4fdb0
        created_by: N/A
        team: N/A
        slack_channel: N/A
    resources:
      requests:
        cpu: 500m
        memory: 128Mi
      limits:
        cpu: 1
        memory: 512Mi
    volumes:
      - emptyDir: {}
        name: k6-provision-location
    volumeMounts:
      - mountPath: /data
        name: k6-provision-location
    envFrom:
    - configMapRef:
        name: ad2f79e1-envs
    image: 036476006320.dkr.ecr.us-west-1.amazonaws.com/external-dockerhub/grafana/k6-extended:v2025.08.22-main10-latest-amd64

Other environment details (if applicable)

No response

Steps to reproduce the problem

I am not seeing sidecar containers spawned under runner pods. I am seeing them under initializer pods and they are not sidecar. Initializer pods stuck waiting for sidecar container to finish which will never happen because my sidecar containers are supposed to run in parallel with runnders until they exit.

Expected behaviour

There should be foo-sidecar container spawned when runner pods when initializer pods done spawning runner pods

Actual behaviour

foo-sidecar containers are started insdie -initializer pods and that too as init containers. They are not sidecar containers and spawned under wrong pods (initializers instead of runnners)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions