One of the items that needs to be learnt the process of listing items inside the environment. the kubectl get command does this. In the examples below we are working with a test cluster designated test50 and a tenant named tenant1. Note in which scenarios the namespace is specified with the -n parameter and which not.
kubectl get nodes
The above lists all the nodes that are currently part of the Kubernetes cluster.
List the nodes with performance metrics can be done with the following command
kubectl top nodes
⚠️ NOTE: Memory allocation per node should never exceed 80%. This is required so that there is enough headroom for the cluster and the pods they may have to burst the available memory.
kubectl get ns
Note how the cluster name is reflected in one namespace and tenant1 in another.
Below is the command to do a basic listing.
kubectl -n tenant1 get pods
Below is the command to do a more advanced listing with pod IP’s and the node they reside on. Note that this is important when troubleshooting system issues as the issue can be specific to a node.
kubectl -n tenant1 get pods -o wide
NOTE: the -o is not zero but a lowercase o.
Listing pods with performance counters
kubectl -n tenant1 top pods
kubectl -n tenant1 get pvc
The command for listing secrets is the following:
kubectl -n tenant1 get secrets
kubectl -n tenant1 get sts
kubectl -n tenant1 get deployments