How to Copy Files From Pod to Host.
Problem
Sample scenario: While modifying the configMap [argocd-cm] inside Sunpike-server pod. The recommended option is to take a backup of the comfigmap in yaml file format. Since, these files are residing inside pod, once the pod crashes the files will be lost in case of ephemeral volumes. To avoid this, we need copy the files from the pod to the host server.
Environment
- Platform9 Managed Kubernetes - v-5.4. and Higher
Procedure
From the Master node terminal execute below command, using which we can copy any file from pod to current master node:
kubectl cp <some-namespace>/<some-pod>:/tmp/foo_in_pod /tmp/bar_in_master_node
Was this page helpful?