Reputation: 25
I am running my script inside a Kubernetes container and a zip file is downloaded.
I want to verify how can I access the content inside a zip file when I am triggering tests from a windows machine and the tests are running inside the Kubernetes container through automation.
How can I do mapping of the Kubernetes downloads folder so that I can access it as a windows folder on my local machine even after the testcase execution is completed.
Upvotes: 1
Views: 2604
Reputation: 30160
I want to verify how can I access the content inside a zip file when I am triggering tests from a windows machine and the tests are running inside the Kubernetes container through automation.
If it's possible for you to write API uploading the zip file to storage you can do that also. Like S3 AWS or any other storage and access file from there, which may cost some extra if zip files are large.
There is also other option to save data in Disk Persitenet volume, if you are running managed services GKE, EKS you wont be able to access that data directly to local PC.
If you are running locally on windows PC you can mount the folder to POD and access created zip to local system.
How can I do mapping of the Kubernetes downloads folder so that I can access it as a windows folder on my local machine even after the testcase execution is completed.
You can use hostpath Volume type in your pod spec to mount a file or directory from the host node’s filesystem.
POD example :
apiVersion: v1
kind: Pod
metadata:
name: hostpath-volume-pod
spec:
containers:
- name: my-hostpath-volume-pod
image: <Image name>
volumeMounts:
- name: foo
mountPath: "C:\\etc\\foo"
readOnly: true
volumes:
- name: foo
hostPath:
path: "C:\\etc\\foo"
Upvotes: 1
Reputation: 879
you will need to attach persistent volume with the pods.
Concept https://kubernetes.io/docs/concepts/storage/persistent-volumes/
This link provide options if you are using docker desktop. Kubernetes persistent volume on Docker Desktop (Windows)
Upvotes: 0