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