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/v1beta2kind: Deploymentmetadata:name: go-demo-2-dbspec:...template:...spec:containers:- name: dbimage: mongo:3.3resources:limits:memory: 8Gicpu: 0.5requests:memory: 4Gicpu: 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 \--recordkubectl get pods
...
Access this course and 1500+ top-rated courses and projects.