How to download file from Windows Container in Rancher?

2/19/2022

I have deployed an application in a windows container, It's working as expected. I can browse the file as well using commands like cd, dir and more in its shell. and see its content. But these are very large files so it's a very bad experience in seeing the content of the file. Is there any way to download these files on the local system, so that I can use notepad or notepadd++ type tool to view the content?

As answered by @gohm'c below, I have run the below command, but it's giving the below error.

kubectl cp fxtrader-559547b674-x9wtn:/Logs/MyApp/2022/02/MyApp_2022-02-10-02.log abc.txt

Error:

Unable to connect to the server: dial tcp 127.0.0.1:8080: connectex: No connection could be made because the target machine actively refused it.

enter image description here

-- vivek nuna
devops
docker
kubernetes
rancher

1 Answer

2/19/2022

You can copy the file over to your local disk like kubectl cp <pod name>:<path to the file in Windows container WITHOUT drive letter> <local file path>. Example: kubectl cp busybox:/data/file/huge.logs ./huge.logs

-- gohm&#39;c
Source: StackOverflow