K
Q

How to copy a file from host to Kubernetes container?

4/14/2019

I want to copy a file from my Ubuntu machine to kube-controller-manager-ubuntu container. Currently I do that like this, but I think it has more straight solution in Kubernetes.

Does anyone know how to copy a file to a Kubernetes container?

-- yasin lachini
kubernetes

Similar Questions

How to go inside into the one of the node in K8S
Kubernetes Clustsr stuck on removing PV/PVC
Accessing subdomains of webapp handled by nginx-ingress
Kubernetes Node Port Service
How to access a machine in my network from microk8s deployments
Is the Redis cluster installed in k8s have less performance compared to installed standalone?
eksctl apply cluster changes after create
Connect to GKE cluster dynamically using terraform
Helm sub-chart used by multiple instances of the parent
Forbidden error while describe/scale deployment by user system:node:ip.xx
How to define image name in Kubernetes manifest deployment.yml file dynamically or with variables?
How to pass "–kubelet-extra-args" to AWS EKS node group created by Terraform aws_eks_node_group?

1 Answer

4/14/2019

it is similar to docker copy.

kubectl cp /tmp/foo_dir <some-pod>:/tmp/bar_dir

Please refer here for examples and documentation

https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#cp

-- Prateek Jain
Source: StackOverflow