I have a running Gitlab CI pipeline in my Kubernetes cluster.
When the tests are failing, I need to grab the app screenshots and logs from the pod where it ran so that they are available where the Gitlab Runner is expecting them.
I tried the kubectl cp <namespace>/<podname>:/in-pod-path /local/path
to copy the files from a stopped pod (having the tar
command installed in my Docker image), but it isn't yet supported.
Until this is available, I guess I need a volume mounted in the pod at the path where are saved my artefacts so that I can grab them from this volume after the tests execution is finished.
I'm wondering what kind of volume should I use knowing that I have 3 kube workers, I don't need that volume to be persistent over time, more to be shared across the nodes?
I'm expecting to deploy this volume before deploying the pod running my tests mounting this volume. When tests failure is detected, I would extract the artefacts to the right place and delete the pod and the volume.