English Article · Software

How to get and put files under Kubernetes pod

1. Copy a file from the App_Data/logs/ path of the default/cm-5c57dbd5d5-pqwh9 pod into the local C:/myf/log.txt file:

kubectl cp default/cm-5c57dbd5d5-pqwh9:App_Data/logs/log.20201215.092051.txt /myf/log.txt

2. Copy the Sitecore.ContentTesting.dll file from the local machine into the pod with path bin/Sitecore.ContentTesting.dll

kubectl cp C:\Work\Solutions\CT\code\Sitecore.ContentTesting\bin\Debug\Sitecore.ContentTesting.dll  default/cm-5c57dbd5d5-pqwh9:.\bin\Sitecore.ContentTesting.dll

3. Copy all the files from the App_Data/logs/ path into the local C:/myf/:

kubectl cp default/cm-5c57dbd5d5-pqwh9:App_Data/logs/ /myf/

Note for the #3: please check that all the files are copied, in my case some of them were missed somehow, if you know why it may happens please let me know, thank you in advance!