Allocating Excessive Resources
Explore what happens when we allocate excessive resources than required by an application.
Allocating excessive memory
Let’s explore another possible situation through yet another updated definition go-demo-2-insuf-node
. Just as before, the change is only in the resources
of the go-demo-2-db
Deployment.
Press + to interact
apiVersion: apps/v1kind: Deploymentmetadata:name: go-demo-2-dbspec:...template:...spec:containers:- name: dbimage: mongo:3.3resources:limits:memory: 8Gicpu: 0.5requests:memory: 12Gicpu: 0.3
This time we specify that the requested memory is twice as much as the total memory of the node (6GB). The memory limit is even higher.
Applying the definition
Let’s apply the change and observe what happens.
Press + to interact
kubectl apply \-f go-demo-2-insuf-node.yml \--recordkubectl get pods
The output of the latter command is as follows:
Press + to interact
NAME READY STATUS RESTARTS AGEgo-demo-2-api-... 1/1 Running 0 8mgo-demo-2-api-... 1/1 Running 0 8mgo-demo-2-api-... 1/1 Running 0 9mgo-demo-2-db-... 0/1 Pending 0 13s
This time, the status of the Pod ...