148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}
Chapter 11 ■ Using ConfigMapsFigure 11-6. Creating a ConfigMap from a directoryYou can list the ConfigMap YAML definition with the following command:./kubectl get configmaps mysql-config -o yamlThe mysql-config definition file is listed as shown in Figure 11-7.Figure 11-7. ConfigMap definition file261
Chapter 11 ■ Using ConfigMapsNext, consume the ConfigMap in a replication controller; to do that, create a definition file mysql.yaml:sudo vi mysql.yamlUse the config map mysql-config to obtain environment variable values for the MySQL databaseDocker image mysql.---apiVersion: v1kind: ReplicationControllermetadata:labels:app: mysql-appname: mysqlspec:replicas: 3selector:app: mysql-apptemplate:metadata:labels:app: mysql-appspec:containers:-env:-name: MYSQL_ROOT_PASSWORDvalueFrom:configMapKeyRef:key: mysql.root.passwordname: mysql-config-name: MYSQL_DATABASEvalueFrom:configMapKeyRef:key: mysql.databasename: mysql-config-name: MYSQL_USERvalueFrom:configMapKeyRef:key: mysql.username: mysql-config-name: MYSQL_PASSWORDvalueFrom:configMapKeyRef:key: mysql.username: mysql-config-262
- Page 225 and 226: Chapter 9 ■ Scheduling Pods on No
- Page 227 and 228: Chapter 9 ■ Scheduling Pods on No
- Page 229 and 230: Chapter 9 ■ Scheduling Pods on No
- Page 231 and 232: Chapter 9 ■ Scheduling Pods on No
- Page 233 and 234: Chapter 9 ■ Scheduling Pods on No
- Page 235 and 236: Chapter 9 ■ Scheduling Pods on No
- Page 237 and 238: Chapter 9 ■ Scheduling Pods on No
- Page 239 and 240: Chapter 9 ■ Scheduling Pods on No
- 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: Chapter 11 ■ Using ConfigMapsFigu
- 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 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
Chapter 11 ■ Using ConfigMaps
Figure 11-6. Creating a ConfigMap from a directory
You can list the ConfigMap YAML definition with the following command:
./kubectl get configmaps mysql-config -o yaml
The mysql-config definition file is listed as shown in Figure 11-7.
Figure 11-7. ConfigMap definition file
261