Search⌘ K

Getting Practical with Container Memory and CPU Resources

Explore how to practically manage memory and CPU resources for containers in Kubernetes. Understand how to set limits and requests, interpret node and Pod resource usage, and ensure the overall cluster stays within capacity. Gain hands-on experience with commands and real examples to optimize resource allocation in your Kubernetes environment.

In the previous lesson, we discussed the theory of resources. Let’s get practical by looking into some practical examples related to resources.

Creating the resources

We’ll move on and create the resources defined in the go-demo-2-random.yml file.

Shell
kubectl create \
-f go-demo-2-random.yml \
--record --save-config
kubectl rollout status \
deployment go-demo-2-api

We created the resources and waited until the go-demo-2-api Deployment was rolled out. The output of the later command should be as follows.

Shell
deployment "go-demo-2-api" successfully rolled out

Let’s describe the go-demo-2-api Deployment and see its limits ...