...

/

Exploring the Effects by Violating Quotas

Exploring the Effects by Violating Quotas

Explore how to violate some quotas and analyze the consequences.

Exploring the effects

Now let’s create the objects and explore the effects as we defined the resource quotas in the previous lesson.

Creating the dev namespace

Let’s get started by creating the dev namespace as per our plan:

Press + to interact
kubectl create ns dev
kubectl create \
-f dev.yml \
--record --save-config

We can see from the output that the namespace "dev" is created as well as the resourcequota "dev". To be on the safe side, we’ll describe the newly created devquota.

Press + to interact
kubectl --namespace dev describe \
quota dev

The output is as follows:

Press + to interact
Name: dev
Namespace: dev
Resource Used Hard
-------- ---- ----
limits.cpu 0 1
limits.memory 0 1Gi
pods 0 10
requests.cpu 0 800m
requests.memory 0 500Mi
services.nodeports 0 0

We can see that the hard limits are set and that there’s currently no usage. This is expected since we’re not running any objects in the dev namespace.

Creating resources

Let’s create go-demo-2 objects:

Press + to interact
kubectl --namespace dev create \
-f go-demo-2.yml \
--save-config --record
kubectl --namespace dev \
rollout status \
deployment go-demo-2-api

We created the objects from the go-demo-2.yml file and waited until the go-demo-2-api Deployment rolled out.

Looking into the description

Now we can revisit the values of the dev quota.

Press + to interact
kubectl --namespace dev describe \
quota dev

The output is as follows:

Press + to interact
Name: dev
Namespace: dev
Resource Used Hard
-------- ---- ----
limits.cpu 400m 1
limits.memory 130Mi 1Gi
pods 4 10
requests.cpu 40m 800m
requests.memory 65Mi 500Mi
services.nodeports 0 0

Judging from the Used column, we can see that we are currently running 4 Pods and still below the limit of 10``. One of those Pods are created through the ...