# How to import custom files from persistent volume claim to k6 operator

**URL:** <https://community.grafana.com/t/how-to-import-custom-files-from-persistent-volume-claim-to-k6-operator/138994>\
**Category:** Grafana k6\
**Created:** [December 24, 2024, 3:21pm UTC](https://community.grafana.com/t/how-to-import-custom-files-from-persistent-volume-claim-to-k6-operator/138994 "2024-12-24T15:21:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nebojsamarjanovic6](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@nebojsamarjanovic6](https://community.grafana.com/u/nebojsamarjanovic6)\
**Post date:** [December 24, 2024, 3:21pm UTC](https://community.grafana.com/t/how-to-import-custom-files-from-persistent-volume-claim-to-k6-operator/138994/1 "2024-12-24T15:21:51Z")

</div>

Hi,  
I want to import a .txt file with requests (stored inside a persistent volume claim) into my k6 operator. Is this possible?

I am creating a configmap from my test script file and applying the k6 operator that references the configmap, but I am struggling to import the .txt file into my test.

Also to mention, .txt file is arround 100Mb so it can’t be referenced as configmap, since it’s too big for that.

---

<div class="post-metadata">

**Author:** ![joanlopez](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/joanlopez/32/12328_2.png) [@joanlopez](https://community.grafana.com/u/joanlopez)\
**Post date:** [December 30, 2024, 6:20pm UTC](https://community.grafana.com/t/how-to-import-custom-files-from-persistent-volume-claim-to-k6-operator/138994/2 "2024-12-30T18:20:42Z")

</div>

Hi @nebojsamarjanovic6,

Welcome to our community forums! 🎉

I’m not an expert on this topic (k8s, nor the k6-operator), so I cannot help here. But let me assign this thread to our expert @olhayevtushenko, and see if they can shed some light.

Note that this may take a bit longer than usual, cause we’re in the middle of a festivity period, and I don’t know their availability to help with this. But I hope they will eventually do 🤞

Regards!

---

<div class="post-metadata">

**Author:** ![olhayevtushenko](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@olhayevtushenko](https://community.grafana.com/u/olhayevtushenko)\
**Post date:** [January 2, 2025, 4:00pm UTC](https://community.grafana.com/t/how-to-import-custom-files-from-persistent-volume-claim-to-k6-operator/138994/4 "2025-01-02T16:00:13Z")

</div>

Thanks @joanlopez!

Hi @nebojsamarjanovic6 👋  
Can you have your script stored in the volume as well? If yes, then the easiest would be to switch to this configuration:

> **[Run k6 scripts with TestRun CRD | Grafana k6 documentation](https://grafana.com/docs/k6/latest/set-up/set-up-distributed-k6/usage/executing-k6-scripts-with-testrun-crd/#volumeclaim)**
>
> Run k6 scripts with TestRun CRD This guide covers how you can configure your k6 scripts to run using the k6 Operator.
> Defining test scripts There are several ways to configure scripts in the TestRun CRD.

If for some reason you need to keep the script separately in a ConfigMap, then you can also mount volumes directly to runners with `.spec.runner.volume` and `.spec.runner.volumeMounts`. These options should be fully specified as is usually done in Kubernetes, [ref. docs](https://kubernetes.io/docs/concepts/storage/volumes/).

Hope that helps!
