19.06.2021 Views

148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 12 ■ Using Resource Quotas

The hard limit on the number of ConfigMaps is 5. Create another file, named mysql.config, and set its

content to mysql. Create, or try to create, the sixth ConfigMap:

./kubectl create configmap mysql-config6 --from-file=/mysql/env/mysql.config

An error message indicates that the number of ConfigMaps is being exceeded, as shown in Figure 12-20.

Figure 12-20. Error message indicates that the object-quotas quota is exceeded for ConfigMaps

Defining Best-Effort Scope Quotas

The BestEffort scope quota is used only for tracking pods. And if excess resources are available, pods in

excess of the hard limit could be scheduled, although the pods (exceeding the hard limit) would be the

first to be terminated if resources are required for another object. To demonstrate, create a ResourceQuota

definition file best-effort-quotas.yaml. Set the hard limit on the number of pods to 5. Set scopes to

BestEffort.

apiVersion: v1

kind: ResourceQuota

metadata:

name: best-effort-quotas

spec:

hard:

pods: "5"

scopes:

-

BestEffort

294

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!