Creating a deployment
The Kubernetes deployment provides updates for ReplicaSets, which ensures that a specified amount of pods (replicas) are running all the time:
The preceding diagram shows a deployment with three pods; the ReplicaSet will try to keep three pods running all the time. Of course, if there are no free resources in the Kubernetes cluster, the running pod replicas might not match the required replica count.
There are a few ways to create a Kubernetes deployment – let's explore them. The easiest way is using $ kubectl create deployment
.
Let's create an nginx
deployment:
$ kubectl create deployment deployment.apps/nginx created
Let's check the created nginx
deployment:
$ kubectl get deployment NAME READY UP-TO-DATE AVAILABLE AGE nginx 1/1 1 ...