While we’ve got it, might as well look around! We’ll use the get command to see that all the parts we learned about above are now present and working on our app!
First, let’s look at our nodes, enter:
kubectl get nodes
NAME STATUS ROLES AGE VERSION
docker-desktop Ready master 1d2h v1.15.5
This will list the names, status, and roles of all the nodes in our cluster. Since our cluster is just a single device test environment, there will be only one.
Now we’ll look at our pods, enter:
kubectl get pods
Again, a table will print with some useful information.
NAME READY STATUS RESTARTS AGE
hello-node-55b49fb9f8-wwpwr 1/1 Running 0 36s
Here, it’s important to note that our pod has only one instance, shown by the 1/1 in the ready column. We can also see that it is currently running from the status column, letting us know that it has not failed.
As a result, the get pods command is useful when troubleshooting a more complex system as it allows you to see which of your many pods is malfunctioning.
If you need more information, you can also use the describe command for specific pods, nodes or even deployments to see a plethora of information available on each resource.
Let’s try it for our deployment, enter:
kubectl describe deployment hello-node