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.
Kubernetes uses requests
to calculate how much CPU power or memory a certain Pod requires. Our guestbook application has requests defined for all the deployments. If you open the guestbook-all-in-one.yaml
file, you'll see the following for the redis-slave
deployment:
... 63Â Â kind: Deployment 64Â Â metadata: 65Â Â Â Â name: redis-slave ... 83Â Â Â Â Â Â Â Â Â Â resources: 84Â Â Â Â Â Â Â Â Â Â Â Â requests: 85Â Â Â Â Â Â Â Â Â Â Â Â Â Â cpu: 100m 86Â Â Â Â Â Â Â Â Â Â Â Â Â Â ...