Score:0

Is there a tool for copying files directly from any running Kubernetes pod to another?

cn flag

I would like to move a large file set from a running Kubernetes pod to another (possibly in another cluster) in order to migrate quickly from one Storage Class to another with little or no downtime.

I want the files to be copied directly from one pod to the other, preferably with rsync.

I have figured out how to accomplish the task, but I am wondering if there is an existing tool before I embark on writing one.

Is there a simple tool for reliably copying files directly from any running Kubernetes pod to another?

NB: 'kubectl cp' cannot accomplish this task as of kubectl v1.25.1

➜  ~ kubectl run --image nginx nginx1       
pod/nginx1 created
➜  ~ kubectl run --image nginx nginx2
pod/nginx2 created
➜  ~ kubectl cp nginx1:/etc/nginx.conf nginx2:/etc/nginx.conf 
error: one of src or dest must be a local file specification
asktyagi avatar
in flag
use `kubectl cp` for example `kubectl cp pod-1:my-file pod-2:my-file`
Dick Fairthorne II avatar
cn flag
@asktyagi - kubectl cp does not accomplish this task as of kubctl v1.25.1. See amendment to question a above for an example.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.