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Â Â Â Â Â Â Â Â Â Â Â Â ...