上QQ阅读APP看书,第一时间看更新
Using the kubectl get command
The first essential command to run is kubectl get nodes. It gives us the number of Kubernetes nodes available:
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready <none> 2h v1.9.0
In our case, the number of nodes will be equal to one, since we are using one VM for our practice. As we mentioned already, in order for different projects to coexist on the same or different nodes, namespaces are used. You may guess that the command we should use is kubectl get namespaces:
$ kubectl get namespaces
NAME STATUS AGE
default Active 15h
kube-public Active 15h
kube-system Active 15h
It says No resources found, all because the pod is a Kubernetes resource, similar to other resources we are going to cover in this book.
Similarly to kubectl get pods, you can get the status of any other Kubernetes resource. We will discuss other Kubernetes resources later in this chapter.