Monitoring applications and metrics in Kubernetes
When we deploy an application in Kubernetes, it's very important—and I consider it a requirement—to have a monitoring strategy for checking and debugging the life cycle of these applications and checking the central processing unit (CPU) and random-access memory (RAM) metrics.
We will now discuss different ways to debug and monitor your applications in Kubernetes.
Let's start with the basic way, which is the use of the kubectl
command line.
Using the kubectl command line
To debug applications with the kubectl
command line, run the commands detailed next:
- To display the state of Kubernetes resources, run the following command:
kubectl get pods,svc
The output of the preceding command is shown in the following screenshot:
With this command, we can see if pods are running and find out about services' statuses.
...