The Deployment API was introduced in Kubernetes version 1.2. It is replacing the replication controller. The functionalities of rolling-update and rollback by replication controller, it was achieved with client side (kubectl
command and REST API
), that kubectl
need to keep connect while updating a replication controller. On the other hand, Deployments takes care of the process of rolling-update and rollback at the server side. Once that request is accepted, the client can disconnect immediately.
Therefore, the Deployments API is designed as a higher-level API to manage ReplicaSet objects. This section will explore how to use the Deployments API to manage ReplicaSets.
In order to create Deployment objects, as usual, use the kubectl run
command or prepare the YAML/JSON file that describe Deployment configuration. This example is using the kubectl run
command to create a my-nginx
Deployment object:
//create my-nginx Deployment (specify 3 replicas and nginx version...