148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}
Chapter 12 ■ Using Resource QuotasListing the pods cluster-wide indicates that each of the pods was scheduled on a different node, asshown in Figure 12-16.Figure 12-16. Each of the three pods is scheduled on a different node, keeping in consideration the resourceconsumptionNext, create another replication controller from another RC definition file, similar to the first. Thesecond RC is not created, and the error message indicates that the object-quotas quota is exceeded, asshown in Figure 12-17.Figure 12-17. Error message indicates that the object-quotas quota is exceeded forreplicationcontrollersThe hard limit on the number of services is 2. Create one service and create another with a differentname than the default. The second service is not created, and the error message indicates that the objectquotaquota is being exceeded, as shown in Figure 12-18.Figure 12-18. Error message indicates that the object-quotas quota is exceeded for services292
Chapter 12 ■ Using Resource QuotasNext, we shall demonstrate exceeding a ConfigMaps quota. Chapter 11 showed how to createConfigMaps, but I’ll briefly repeat the procedure here. We shall create some ConfigMaps from files in adirectory. The file names must be the same as the ConfigMap key, and the value is the content of the file.Create a directory and set its permissions:sudo mkdir /mysql/envsudo chmod -R 777 /mysql/envcd /mysql/envAdd the five files listed in Table 12-3 to the directory.Table 12-3. Files from Which to Create ConfigMapsFilemysql.root.passwordmysql.databasemysql.usermysql.passwordmysql.allow.empty.passwordContentmysqlmysqldbmysqlmysqlnoCreate five ConfigMaps from the five files../kubectl create configmap mysql-config --from-file=/mysql/env/mysql.root.password./kubectl create configmap mysql-config2 --from-file=/mysql/env/mysql.database./kubectl create configmap mysql-config3 --from-file=/mysql/env/mysql.user./kubectl create configmap mysql-config4 --from-file=/mysql/env/mysql.password./kubectl create configmap mysql-config5 --from-file=/mysql/env/allow.empty.passwordThe five ConfigMaps are created as shown in Figure 12-19.Figure 12-19. Creating ConfigMaps293
- 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 and 292: Chapter 11 ■ Using ConfigMapsmoun
- Page 293 and 294: CHAPTER 12Using Resource QuotasIn C
- 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: 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
- Page 343 and 344: Chapter 14 ■ Configuring LoggingF
- Page 345 and 346: Chapter 14 ■ Configuring LoggingF
- Page 347 and 348: CHAPTER 15Using an HA Master with O
- Page 349 and 350: Chapter 15 ■ Using an HA Master w
- Page 351 and 352: Installing the Network ManagerChapt
- Page 353 and 354: Chapter 15 ■ Using an HA Master w
- Page 355 and 356: Chapter 15 ■ Using an HA Master w
Chapter 12 ■ Using Resource Quotas
Next, we shall demonstrate exceeding a ConfigMaps quota. Chapter 11 showed how to create
ConfigMaps, but I’ll briefly repeat the procedure here. We shall create some ConfigMaps from files in a
directory. The file names must be the same as the ConfigMap key, and the value is the content of the file.
Create a directory and set its permissions:
sudo mkdir /mysql/env
sudo chmod -R 777 /mysql/env
cd /mysql/env
Add the five files listed in Table 12-3 to the directory.
Table 12-3. Files from Which to Create ConfigMaps
File
mysql.root.password
mysql.database
mysql.user
mysql.password
mysql.allow.empty.password
Content
mysql
mysqldb
mysql
mysql
no
Create five ConfigMaps from the five files.
./kubectl create configmap mysql-config --from-file=/mysql/env/mysql.root.password
./kubectl create configmap mysql-config2 --from-file=/mysql/env/mysql.database
./kubectl create configmap mysql-config3 --from-file=/mysql/env/mysql.user
./kubectl create configmap mysql-config4 --from-file=/mysql/env/mysql.password
./kubectl create configmap mysql-config5 --from-file=/mysql/env/allow.empty.password
The five ConfigMaps are created as shown in Figure 12-19.
Figure 12-19. Creating ConfigMaps
293