Difference between revisions of "Kubectl cp"

From wikieduonline
Jump to navigation Jump to search
Line 2: Line 2:
 
* https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#cp
 
* https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#cp
 
  [[kubectl]] cp
 
  [[kubectl]] cp
 +
 +
kubectl cp youfile.txt remotepod:/yourdata
  
 
  [[kubectl apply -f]]
 
  [[kubectl apply -f]]

Revision as of 22:55, 23 October 2023

kubectl cp
kubectl cp youfile.txt remotepod:/yourdata
kubectl apply -f

https://stackoverflow.com/questions/50375826/kubernetes-how-to-download-a-persistentvolumes-content

apiVersion: v1
kind: Pod
metadata:
  name: dataaccess
spec:
  containers:
  - name: alpine
    image: alpine:latest
    command: ['sleep', 'infinity']
    volumeMounts:
    - name: mypvc
      mountPath: /data
  volumes:
  - name: mypvc
    persistentVolumeClaim:
      claimName: mypvctocopy
kubectl cp dataaccess:/data data/
tar: removing leading '/' from member names


See also

Advertising: