Solving out-of-resource failures
Another common issue that can come up with Kubernetes clusters is the cluster running out of resources. When the cluster doesn't have enough CPU power or memory to schedule additional pods, pods will become stuck in a Pending
state. You have seen this behavior in Chapter 4, Building scalable applications, as well.
Kubernetes uses requests to calculate how much CPU power or memory a certain pod requires. The guestbook application has requests defined for all the deployments. If you open the guestbook-all-in-one.yaml
file in the folder Chapter05
, you'll see the following for the redis-replica
deployment:
63 kind: Deployment 64 metadata: 65 name: redis-replica ... 83 resources: 84 requests: 85 ...