Difference between revisions of "Kubectl cp"
Jump to navigation
Jump to search
Line 11: | Line 11: | ||
kind: Pod | kind: Pod | ||
metadata: | metadata: | ||
− | name: | + | name: myalpinedataaccess |
spec: | spec: | ||
containers: | containers: | ||
Line 25: | Line 25: | ||
claimName: mypvctocopy | claimName: mypvctocopy | ||
− | kubectl cp | + | kubectl cp myalpinedataaccess:/data data/ |
[[tar]]: removing leading '/' from member names | [[tar]]: removing leading '/' from member names | ||
Revision as of 23:00, 23 October 2023
kubectl cp
kubectl cp youfile.txt remotepod:/yourdestinationdata
kubectl apply -f
https://stackoverflow.com/questions/50375826/kubernetes-how-to-download-a-persistentvolumes-content
apiVersion: v1 kind: Pod metadata: name: myalpinedataaccess spec: containers: - name: alpine image: alpine:latest command: ['sleep', 'infinity'] volumeMounts: - name: mypvc mountPath: /data volumes: - name: mypvc persistentVolumeClaim: claimName: mypvctocopy
kubectl cp myalpinedataaccess:/data data/ tar: removing leading '/' from member names
kubectl exec <pod_name> -- ls -la /
kubectl exec myalpine -- df -kh
See also
cp
,dd
,sftp
,scp
,rsync
,casync
,mv
,fio
,ln
,docker cp, kubectl cp
,minikube cp
,multipass transfer
,Copy-Item
,Xcopy
kubectl
: [cp | config | create
|delete
|edit | explain |
apply
|exec
|get
|set
|drain | uncordon | rolling-update
|rollout
|logs
|run
|auth
|label | annotate
|version
|top
|diff
|debug
|replace
|describe
|port-forward | proxy
|scale
|rollout
|api-resources
| expose deployment | expose | patch | attach | get endpoints | ~/.kube/config | kubectl logs --help | kubectl --help, kubectl-convert, kubectl autoscale, kubectl.kubernetes.io
Advertising: