Kubernetes

kubectl cp

SafeCopy to/from pod

kubectl cp <ns>/<pod>:<path> <localpath>

Copies files between a pod and local; grab logs/config.

Examples

  • kubectl cp prod/web-xyz:/var/log/app.log ./app.logPull out a log

Syntax

kubectl cp <ns>/<pod>:<src> <dest> (works both directions)

Before you run it

Copy only.

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store