grafana / k6-operator

An operator for running distributed k6 tests.
Apache License 2.0
541 stars 147 forks source link

feat: differentiate between Runner and Initializer initContainers #379

Closed FloGro3 closed 3 months ago

FloGro3 commented 4 months ago

Fixes 296

Enables you to have separate initContainers for the initializer and runner pod.

Was tested successfully in own K8 environment (only the initializer pod was configured to have initContainers): image

Config looks like this:

initializer:
    ...
    {{- if .Values.executor.script.volumeClaim }}
    initContainers:
      - image: {{ tpl $.Values.docker.registry $ }}/{{ tpl $.Values.image.name $ }}:{{ tpl $.Values.image.tag $ }}
        {{- if .Values.image.command }}
        command: [ "sh", "-c", {{ .Values.image.command }} ]
        {{- else }}
          {{- with (index .Values.mount.pvcs 0) }}
        command: [ "sh", "-c", "cp -r /home/* {{ .path }};" ]
          {{- end }}
        {{- end }}
    {{- end }}
CLAassistant commented 4 months ago

CLA assistant check
All committers have signed the CLA.

FloGro3 commented 4 months ago

@yorugac Sure, I've added a small example.