Skip to main content
Skip table of contents

Kubernetes listing resources

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.

Listing nodes

CODE
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

CODE
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.

Listing namespaces

CODE
kubectl get ns

Note how the cluster name is reflected in one namespace and tenant1 in another.

Listing pods

Below is the command to do a basic listing.

CODE
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.

CODE
kubectl -n tenant1 get pods -o wide

NOTE: the -o is not zero but a lowercase o.

Listing pods with performance counters

CODE
kubectl -n tenant1 top pods

Listing PVC’s

CODE
kubectl -n tenant1 get pvc

Listing secrets

The command for listing secrets is the following:

CODE
kubectl -n tenant1 get secrets

List STS’s

CODE
kubectl -n tenant1 get sts

List deployments

CODE
kubectl -n tenant1 get deployments

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.