...

/

Allocating Excessive Resource than the Actual Usage

Allocating Excessive Resource than the Actual Usage

In this lesson, we will explore what happens when we allocate excessive resource than the actual usage of an application.

Allocating Excessive Memory

Let’s explore another possible situation through yet another updated definition.

cat res/go-demo-2-insuf-node.yml

Just as before, the change is only in the resources of the go-demo-2-db Deployment. The output, limited to the relevant parts, is as follows.

apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: go-demo-2-db
spec:
...
template:
...
spec:
containers:
- name: db
image: mongo:3.3
resources:
limits:
memory: 8Gi
cpu: 0.5
requests:
memory: 4Gi
cpu: 0.3

This time, we specified that the requested memory is twice as much as the total memory of the node (2GB). The memory limit is even higher.

Applying the Definition

Let’s apply the change and observe what happens.

kubectl apply \
-f res/go-demo-2-insuf-node.yml \
--record
kubectl get pods
...
Access this course and 1500+ top-rated courses and projects.