Kubernetes - Deployment
- Deployments are a Kubernetes resource that manages a replica set of Pods.

Replica Sets
- Replica Sets are a Kubernetes resource that ensures a specified number of Pods are running at all times.
- Deployments are a higher-level abstraction that manages Replica Sets. (You can think of a Deployment as a wrapper around a ReplicaSet.)
- Deployments allow you to define the desired state of your application and automatically manage the Replica Sets to achieve that state.
Thrashing Pods
- Pods are ephemeral, meaning they can be terminated and replaced at any time.
- Thrashing is a term used to describe the process of Pods being terminated and replaced in quick succession.
- Reasons for thrashing include:
- The application recently had a bug introduced in the latest image version
- The application is misconfigured and can’t start properly
- A dependency of the application is misconfigured and the application can’t start properly
- The application is trying to use too much memory and is being killed by Kubernetes
CrashLoopBackOff
-
CrashLoopBackOff is a state that Pods enter when they are crashing on startup.
-
The container keeps exiting and getting restarted, usually with a non-zero exit code (but even exit 0 counts under
restartPolicy: Always, e.g. a script that just finishes). -
This state is often caused by a misconfiguration in the application or a dependency.
-
Because Kubernetes is all about building self-healing systems, it will automatically restart the container. However, each time it tries to restart the container, if it crashes again, it will wait longer and longer in between restarts. That’s why it’s called a “backoff”.