Similar Docker commands in kubectl
The following is a list of the most useful Docker commands, followed by their equivalents in kubectl
.
Getting information is done with the following commands:
docker info
kubectl cluster-info
Getting version information is done with the following commands:
docker version
kubectl version
Running a container and exposing its port is done with the following commands:
docker run -d --restart=always --name nginx -p 80:80 nginx
kubectl create deployment --image=nginx nginx
kubectl expose deployment nginx --port=80 --name=nginx
Getting container logs is done with the following commands:
docker logs --f <container name>
kubectl logs --f <pod name>
Executing into a running container/pod shell is done with the following commands:
docker exec –it <container name> /bin/bash
kubectl exec –it <pod name>
Getting a list of...