How to send a command to running container in Kubernetes?

1/16/2017

I can get the IP address of the exposed container through:

kubectl get service hello-node

Say that I want to run ls on this container and obtain the results. How could I do that?

-- exon ball
containers
kubernetes

1 Answer

1/16/2017

you might want to use kubectl exec .... To run lson a containers run:

kubectl exec <pod> ls

You'll find the pod-id with:

kubectl get pods

The full documentation can be found on kubernetes.io

Cheers

-- pagid
Source: StackOverflow