Skip to content

kx cp

Copies files to or from an indexed pod via kubectl cp. Either side of the copy can name a path inside the pod as index:path.

A flag kx doesn’t know is refused; put it after -- to pass it through to kubectl.

Usage

kx cp [OPTIONS] <src> <dest> [kubectl flags]

Arguments

ArgumentDescription
<src>Source path, or <index>:<path> inside the pod
<dest>Destination path, or <index>:<path> inside the pod

Options

OptionDescription
-c, --container stringContainer name, if the pod has more than one
--no-preserveDon’t preserve the copied file/directory’s ownership and permissions
--retries intNumber of retries on a copy failure (0 disables)

Passthrough options

OptionDescription
…kubectl’s global flags too: --context, --kubeconfig, --as and the rest; kubectl options lists them

Global options

OptionDescription
--no-colorDisable styled output
-h, --helpShow this message and exit

Examples

kx cp 1:/var/log/app.log ./app.log
kx cp ./patch.conf 1:/etc/app/patch.conf