Skip to main content

Posts

Showing posts with the label deployments

Kubernetes: 18. Rollout and Rollback

Deployment When a deployment is created, it triggers a rollout Rollout creates a new revision (version) In the future when new deployment is created,  a new rollout is created The new rollout creates one more "new" version These versions help to keep track of the changes and rollback if necessary Deployment Strategy First strategy is delete and recreate strategy.  Delete all the existing pods and deploy the new updated pods But this comes with application downtime Second strategy and default strategy is Rolling update strategy Kubernetes deletes one pod at a time in the older version and in its place creates a one pod at a time in the newer version Update Strategy Updates can be many things like updating the labels, docker image, replicas etc These are directly updated into the deployment file and the changes are applied When the changes are applied using kubectl apply command, a new rollout and a new revision is created Another way to update the image name is to use the kube...

Kubernetes: 3. Deployments

What is Deployment in Kubernetes? Deployment is a Kubernetes object It is a higher level object, above the replica set A Deployment provides declarative updates for Pods and ReplicaSets. You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments. A deployment automatically creates the replica set Replica set created by deployment should not be managed manually Uses of Deployment Run multiple instances of applications Upgrade the docker instances seamlessly - Upgrade one after the other - Rolling updates! Rollback the recent changes Upgrade the webservers / Scaling the environment / Update the resources - All at a single time Pause and Resume the upgrades deployment-definition.yaml apiVersion: apps/v1 kind: Deployment metadata:      name: myapp-depl...