Controlling Deployments
Though ReplicaSets contain much of the functionality you would want to run a high availability application, most of the time you will want to use Deployments to run applications on Kubernetes.
Deployments have a few advantages over ReplicaSets, and they actually work by owning and controlling a ReplicaSet.
The main advantage of a Deployment is that it allows you to specify a rollout
procedure – that is, how an application upgrade is deployed to the various pods in the Deployment. This lets you easily configure controls to stop bad upgrades in their tracks.
Before we review how to do this, let's look at the entire spec for a Deployment:
deployment.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: myapp-deployment labels: app: myapp spec: replicas: 3 strategy: type: RollingUpdate rollingUpdate: ...