-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: can be mount ConfigMap/Secret to k6 pods #123
Comments
Thank you for reply @yorugac |
No, it doesn't have such limitations, it's just a normal volume. More precisely, runner does expect to find the script there but you can store any other data as well, e.g. any additional files like JSONs or images, etc. If the script uses those files, then k6 would reference the mounted folder the same way it does normally. Example:
Then your |
Oh, sorry, my understanding was incorrect. |
@mugioka I see, I was looking at your PR and was thinking about volumes themselves mostly. But if the problem is with secrets, then k6-operator/config/crd/bases/k6.io_k6s.yaml Line 791 in c63b127
So it should be possible to access Secret as an env var. It looks like it is present in envFrom as well, by the way.
Also, if the key is in Those are the options now, I believe. |
@yorugac |
Hi @mugioka, sorry for the delay. So regarding your example, it really depends on the exact requirements of your setup. E.g. you could put it into an image and use security context for test's execution - maybe that's sufficient? I don't think there is a silver bullet here, it's a matter of the product requirements. FYI, we have something similar planned for Vault support: #103 I'm also rather curious if there's additional interest in this kind of features. |
Yes, it is feasible to do so. However, I would prefer to be able to VolumeMount the Secret, as I find it less convenient to have to build a custom docker image when I just want to include sensitive values in a container.
This is a good feature for those who manage sensitive values outside the repository (Vault). |
@yorugac I'm running into this need as well. I scenario is that our CI/CD is making our custom K6 modules and loading it onto the PVC so that the Runners have the latest readily available. As of now I see no way to import { check, group, sleep } from 'k6';
import http from 'k6/http';
import { uuidv4 } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js';
import { generateEnrollment } from 'v1/generators/enrollment.js'; # i cannot get any path to work Ive also found a related ticket here #121 |
I'm also running into this issue If we want to use mTLS client certs in the k6 job container, it's optimal to mount a secret as a volume Provisioning a PersistentVolume and then populating it with the certs isn't a good workflow Also, copying credentials such as private keys etc into a container image is not good practice |
motivation
I am dealing with binaries (jpeg images) in k6 script as shown below. However, I am having trouble mounting the volume to k6 pods with my current K6 CR.
The text was updated successfully, but these errors were encountered: