148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}
Chapter 11 ■ Using ConfigMapsFigure 11-24. Pod description lists volume of type ConfigMapSummaryIn this chapter we introduced ConfigMaps, which are maps of configuration properties that may be used inKubernetes object definitions such as pods, replication controllers, and also to set environment variablesand command arguments. Subsequently we discussed creating ConfigMaps from directories, files, andliteral values, and finally consuming the ConfigMaps. In the next chapter we shall discuss setting resourcequotas.277
CHAPTER 12Using Resource QuotasIn Chapter 10 we introduced a resource consumption model based on requests and limits, using whichresources (CPU and memory) are allocated to a pod’s containers.ProblemAlthough we discussed allocating resources to a pod’s containers, we did not take some other factors intoconsideration. The resource requirements vary from one development team to another. If one developmentteam were to use all or most of the resources on a node, another team would not be able to run anyapplication on the same node. Second, the resource requirements vary across the different phases ofapplication development. Application development would have different resource usage than applicationtesting and application in-production work. The resource allocation pattern discussed in Chapter 10 doesnot provide a solution for any of these factors.SolutionKubernetes provides a management design pattern for elastic quotas. Elastic quotas are not completelyelastic, and a fixed upper limit that is flexible to some extent based on the scope (discussed later in thischapter) is imposed. Resource quotas are a specification for limiting the use of certain resources in aparticular namespace. The quota is not on a particular object, such as a pod or a replication controller, buton the aggregate use within a namespace. The objective is to provide a fair share of resources to differentteams, with each team assigned a namespace with quotas. Another application of quotas is creating differentnamespaces for production, development, and testing; different phases of application development havedifferent resource requirements. Creating or updating a resource should not exceed the quota restraint,failing which the resource is not created or updated, and an error message is generated. Quotas could beset on compute resources (CPU and memory), which were discussed in chapter 10, and object counts (suchas pods, replication controllers, services, load balancers, and ConfigMaps, to list a few). When a quota isset for compute resources, requests or limits must be specified for those resources. Quotas are enabled bydefault. The total cluster capacity, which could vary if nodes are added or removed, is not a limiting factorwhen setting quotas. The total of the quotas of namespaces could exceed the cluster capacity, and resourcecontention will be resolved on a first-come-first-served basis. Resource contention is resolved before aresource is created and does not affect resources already created. Once a resource has been created, anychanges to the quota setting do not affect the resource.© Deepak Vohra 2017D. Vohra, Kubernetes Management Design Patterns, DOI 10.1007/978-1-4842-2598-1_12279
- Page 241 and 242: Chapter 9 ■ Scheduling Pods on No
- Page 243 and 244: Chapter 9 ■ Scheduling Pods on No
- Page 245 and 246: Chapter 9 ■ Scheduling Pods on No
- Page 247 and 248: Chapter 9 ■ Scheduling Pods on No
- Page 249 and 250: Chapter 9 ■ Scheduling Pods on No
- Page 251 and 252: Chapter 9 ■ Scheduling Pods on No
- Page 253 and 254: Chapter 10 ■ Configuring Compute
- Page 255 and 256: Chapter 10 ■ Configuring Compute
- Page 257 and 258: Chapter 10 ■ Configuring Compute
- Page 259 and 260: Chapter 10 ■ Configuring Compute
- Page 261 and 262: Chapter 10 ■ Configuring Compute
- Page 263 and 264: Chapter 10 ■ Configuring Compute
- Page 265 and 266: Chapter 10 ■ Configuring Compute
- Page 267 and 268: Chapter 10 ■ Configuring Compute
- Page 269 and 270: Chapter 10 ■ Configuring Compute
- Page 271 and 272: Chapter 10 ■ Configuring Compute
- Page 273 and 274: Chapter 11 ■ Using ConfigMapsIn t
- Page 275 and 276: Chapter 11 ■ Using ConfigMapsFigu
- Page 277 and 278: Chapter 11 ■ Using ConfigMapsNext
- Page 279 and 280: Chapter 11 ■ Using ConfigMapsThe
- Page 281 and 282: Chapter 11 ■ Using ConfigMapsCrea
- Page 283 and 284: Chapter 11 ■ Using ConfigMapsFigu
- Page 285 and 286: Chapter 11 ■ Using ConfigMapsCrea
- Page 287 and 288: Chapter 11 ■ Using ConfigMapsFigu
- Page 289 and 290: Chapter 11 ■ Using ConfigMapsCons
- Page 291: Chapter 11 ■ Using ConfigMapsmoun
- Page 295 and 296: Chapter 12 ■ Using Resource Quota
- Page 297 and 298: Chapter 12 ■ Using Resource Quota
- Page 299 and 300: Chapter 12 ■ Using Resource Quota
- Page 301 and 302: Chapter 12 ■ Using Resource Quota
- Page 303 and 304: Chapter 12 ■ Using Resource Quota
- Page 305 and 306: Chapter 12 ■ Using Resource Quota
- Page 307 and 308: Chapter 12 ■ Using Resource Quota
- Page 309 and 310: Chapter 12 ■ Using Resource Quota
- Page 311 and 312: Chapter 12 ■ Using Resource Quota
- Page 313 and 314: CHAPTER 13Using AutoscalingStarting
- Page 315 and 316: Chapter 13 ■ Using AutoscalingThe
- Page 317 and 318: Chapter 13 ■ Using AutoscalingFig
- Page 319 and 320: Chapter 13 ■ Using Autoscaling./k
- Page 321 and 322: Chapter 13 ■ Using AutoscalingFig
- Page 323 and 324: CHAPTER 14Configuring LoggingLoggin
- Page 325 and 326: Chapter 14 ■ Configuring Logging
- Page 327 and 328: Docker Log FilesChapter 14 ■ Conf
- Page 329 and 330: Chapter 14 ■ Configuring LoggingF
- Page 331 and 332: Chapter 14 ■ Configuring LoggingC
- Page 333 and 334: Chapter 14 ■ Configuring Loggingv
- Page 335 and 336: Chapter 14 ■ Configuring LoggingI
- Page 337 and 338: Chapter 14 ■ Configuring LoggingT
- Page 339 and 340: Chapter 14 ■ Configuring Loggingt
- Page 341 and 342: Chapter 14 ■ Configuring LoggingT
CHAPTER 12
Using Resource Quotas
In Chapter 10 we introduced a resource consumption model based on requests and limits, using which
resources (CPU and memory) are allocated to a pod’s containers.
Problem
Although we discussed allocating resources to a pod’s containers, we did not take some other factors into
consideration. The resource requirements vary from one development team to another. If one development
team were to use all or most of the resources on a node, another team would not be able to run any
application on the same node. Second, the resource requirements vary across the different phases of
application development. Application development would have different resource usage than application
testing and application in-production work. The resource allocation pattern discussed in Chapter 10 does
not provide a solution for any of these factors.
Solution
Kubernetes provides a management design pattern for elastic quotas. Elastic quotas are not completely
elastic, and a fixed upper limit that is flexible to some extent based on the scope (discussed later in this
chapter) is imposed. Resource quotas are a specification for limiting the use of certain resources in a
particular namespace. The quota is not on a particular object, such as a pod or a replication controller, but
on the aggregate use within a namespace. The objective is to provide a fair share of resources to different
teams, with each team assigned a namespace with quotas. Another application of quotas is creating different
namespaces for production, development, and testing; different phases of application development have
different resource requirements. Creating or updating a resource should not exceed the quota restraint,
failing which the resource is not created or updated, and an error message is generated. Quotas could be
set on compute resources (CPU and memory), which were discussed in chapter 10, and object counts (such
as pods, replication controllers, services, load balancers, and ConfigMaps, to list a few). When a quota is
set for compute resources, requests or limits must be specified for those resources. Quotas are enabled by
default. The total cluster capacity, which could vary if nodes are added or removed, is not a limiting factor
when setting quotas. The total of the quotas of namespaces could exceed the cluster capacity, and resource
contention will be resolved on a first-come-first-served basis. Resource contention is resolved before a
resource is created and does not affect resources already created. Once a resource has been created, any
changes to the quota setting do not affect the resource.
© Deepak Vohra 2017
D. Vohra, Kubernetes Management Design Patterns, DOI 10.1007/978-1-4842-2598-1_12
279