148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}
Chapter 10 ■ Configuring Compute ResourcesFigure 10-7. The controller node is not schedulableCreating a Pod with Resources SpecifiedIn this section we will create an example pod with a resource request and limit specified for the container.Create a definition file mysql.yaml using the Docker image mysql for a replication controller. Specifycontainer resource request and limit. The same resource type may be specified only once in a list.---apiVersion: v1kind: ReplicationControllermetadata:name: mysql-v1labels:app: mysql-appspec:replicas: 3selector:app: mysql-appdeployment: v1template:metadata:labels:app: mysql-appdeployment: v1spec:containers:-env:-name: MYSQL_ROOT_PASSWORDvalue: mysqlimage: mysqlname: mysql245
Chapter 10 ■ Configuring Compute Resourcesports:-containerPort: 3306resources:requests:memory: "64Mi"cpu: "250m"limits:memory: "128Mi"cpu: "500m"The definition file mysql.yaml is shown in the vi editor in Figure 10-8.Figure 10-8. Replication controller definition file mysql.yamlCreate a replication controller using the definition file:./kubectl create -f mysql.yamlList the cluster-wide pods:./kubectl get pods246
- Page 209 and 210: Chapter 8 ■ Using Rolling Updates
- Page 211 and 212: Chapter 8 ■ Using Rolling Updates
- Page 213 and 214: Chapter 8 ■ Using Rolling Updates
- Page 215 and 216: Chapter 9 ■ Scheduling Pods on No
- Page 217 and 218: Chapter 9 ■ Scheduling Pods on No
- Page 219 and 220: Chapter 9 ■ Scheduling Pods on No
- Page 221 and 222: Chapter 9 ■ Scheduling Pods on No
- Page 223 and 224: Chapter 9 ■ Scheduling Pods on No
- 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: 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 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
Chapter 10 ■ Configuring Compute Resources
ports:
-
containerPort: 3306
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
The definition file mysql.yaml is shown in the vi editor in Figure 10-8.
Figure 10-8. Replication controller definition file mysql.yaml
Create a replication controller using the definition file:
./kubectl create -f mysql.yaml
List the cluster-wide pods:
./kubectl get pods
246