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 infokubectl cluster-info
Getting version information is done with the following commands:
docker versionkubectl version
Running a container and exposing its port is done with the following commands:
docker run -d --restart=always --name nginx -p 80:80 nginxkubectl create deployment --image=nginx nginxkubectl 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/bashkubectl exec –it <pod name>
Getting a list of...