Kubernetes Deployments
Container application deployments within Kubernetes are done through Deployment
resources. Deployment
resources employ ReplicaSet resources behind the scenes, so it would be good to look at ReplicaSet
resources first before we move on to understand Deployment
resources.
ReplicaSet resource
ReplicaSet
resources are Kubernetes resources that help you run multiple replicas of a Pod
at a given time. They provide horizontal scaling for your container workloads, and it forms the basic building block of a horizontal scale set for your containers, which is a group of similar containers tied together to run as a unit.
ReplicaSet
resources define the number of replicas of a Pod
to run at a given time. The Kubernetes controller then tries to maintain the replicas and recreates a Pod
if it goes down.
You should never use ReplicaSet
resources on its own, but instead, it should act as a backend to a Deployment
resource.
For the sake of understanding, however...