The Kubectl client provides a glimpse into what is happening on the onboarded cluster and is a useful tool used for troubleshooting. You can use the GET, DESCRIBE, LOGS, and DELETE commands with Kubectl on CRDs, pods, replica sets, and deployments.

Generally, first use the kubectl get command for pods, replica sets, and deployments in a namespace. For example, to get a list of namespaces in the cluster, run the following command.

kubectl get namespaces

Imagine that one of the namespaces listed is called “bookinfo,” which is the name of a sample app installed on the cluster. To get the pods for bookinfo, run the following command.

kubectl get pods -n bookinfo

The output is a list of pods in the bookinfo namespace and their statuses. Look out for error statuses, indicating the pod is not running for some reason. Copy the entire pod name for a single pod needing further examination and replace {pod name} with that name in the following commands.

kubectl logs {pod name} -n bookinfo kubectl describe pod {pod name} -n bookinfo

If you need to specify a container name, simply add it.

kubectl logs {pod name} -n bookinfo -c {container name}

Even for pods that are not in error status, the above two commands might reveal a setting or behavior that is causing problems. Look for clues about what might not be working. Repeat the commands for other resources, such as these resources:

  • Definition

  • Deployment

  • ReplicaSet

Definition is unique to Tanzu Service Mesh Service Autoscaler. It stands for Autoscaling Definition and is the custom resource that enables configuring the autoscaler. The short name for Definition is asd.