The same may be said for resources assigned to certain containers or namespaces. You must learn how an application acts when it is deployed to scale it and deliver a reliable service. In a Kubernetes cluster, you may monitor application performance by looking at the containers, pods, services, and cluster attributes. At all of these levels, Kubernetes provides extensive information on an app’s resource utilization.
CPU and Memory Utilization in Kubernetes Containers
Containers serve as the foundation for containerized applications. The proportion of CPU resources required by containers in production is referred to as container CPU consumption. Memory consumption is a metric for how much memory is used. Memory is quantified in bytes, while CPU resources are represented in CPU cores.
CPU and Memory Utilization in Kubernetes Pods
Pod CPU use is the aggregate of the CPU use of all containers in a pod. Likewise, pod memory utilization refers to the total aggregate of memory used by all containers in a pod.
In this article, we will support you to understand and check the memory usage in Kubernetes Pods.
To check the memory usage in Kubernetes pods, make sure that you have installed the latest version of Ubuntu in your system. In our illustration, we have installed the Ubuntu 20.04 Linux system. Also, you have to install the minikube cluster in Ubuntu 20.04. Without its installation, you will not be able to get the services of Kubernetes over Ubuntu. Last but not the least, you must have sudo user privileges.
Check Memory Usage of Kubernetes P
To check the memory usage in Kubernetes pods, you have to log in to the root user in Ubuntu 20.04 system. After that, you have to launch the command line terminal. You can launch it by using the application search bar or by using the shortcut key of “Ctrl+Alt+T”. By using any of these approaches, you can open the command line terminal.
Now, the main important step is to start the minikube cluster in your Ubuntu 20.04 system. To achieve your goal, you have to write the basic command listed below and press the Enter key from your keyboard.
It may take some extra time to get started with minikube but during this time, it is recommended to never quit the terminal. In the output of the above-executed command, you can view the version of minikube that is installed on your system. Also, for the latest provided version of minikube cluster, you can click on the link provided in the output of the command.
To track the resource metrics, Metrics-Server is a tool for tracking resource metrics. Metrics-server enables us to use kubectl to query resource metrics directly from the command line. Now by the execution of the below-appended command, you will see pods running in the Kube system.
In the output of the above-executed command, you can see the name of all the pods, their status and age.
Now is the time to get into memory utilization. So, you have to execute the below-listed command in the terminal. After writing it, hit enter key from your system’s keyboard.
In its output, you will get the memory utilization of the Kubernetes pods. To view the resource utilization of the namespace Kube system, you will have to execute the below-written command in the terminal of the Ubuntu 20.04 system. Hit the “Enter” key to view CPU and memory utilization.
You can use any namespace at the replacement of the Kube-system. It is up to your requirement to get your desired utilization for pods in the namespace.
In the aforementioned article, we have explained to you the process to check the memory utilization in Kubernetes pods. We have used Ubuntu 20.04 Linux system but you can utilize your favorite Linux distribution. The memory utilization of the Kubernetes Pods is very important.
It will help you to track and manage the CPU and memory utilization of Kubernetes Pods. Now, I am hopeful that after following every step of this article, you can easily check the memory utilization of every Kubernetes Pod.