On Docker host, we can run docker exec -it ${CONTAINER_ID/CONTAINER_NAME} ${COMMAND} to login and exec command in containers.
On Kubernetes master, we can run kubectl exec -it ${POD_NAME} ${COMMAND} to login and exec command in the container of the pod. If there are multiple containers of the pod, can run the command in specified container.
Both of these two ways are inconvenient and unsecured, as they need to login the Docker host or Kubernetes master, and have the permission to run some other dangerous commands.
A better way is to login and run command in container through websocket.
On Docker host, we can run
docker exec -it ${CONTAINER_ID/CONTAINER_NAME} ${COMMAND}
to login and exec command in containers.On Kubernetes master, we can run
kubectl exec -it ${POD_NAME} ${COMMAND}
to login and exec command in the container of the pod. If there are multiple containers of the pod, can run the command in specified container.Both of these two ways are inconvenient and unsecured, as they need to login the Docker host or Kubernetes master, and have the permission to run some other dangerous commands.
A better way is to login and run command in container through websocket.
Reference