Kubernetes Deployment

Leave behind all doubts and fears. For the path ahead is filled with grace.

Kubernetes-02

  1. Replication Controller and Replica Set don’t provide the updates and rollback for the application in the cabinets cluster. But in a deployment, the object does.
  2. The deployment object works as a supervisor for the pods which gives granular control over the pods.
  3. Deployment objects can decide how and when the pods should be deployed, rollback or updated.
  4. In Deployment, we define the desired state and the deployment controller will help to achieve the desired state from the current state. You can achieve this by declarative(manifest) method only.?
  5. Deployment object supports rollback which means if the app is crashing in a new update then you can easily switch to the previous version by rollback.
  6. The deployment object doesn’t work directly with the pods. Under the deployment object, there will be a replica set or replica controller that manages the pods and helps to manage the desired state.
  7. With the help of deployment, the replica set will be rolled out, which will deploy the pods and check the status in the background whether the rollout has succeeded or not.
  8. If the pod template spec is modified then, the new replica set will be created with the new desired state and the old replica set will still exist and you can roll back according to the situation.
  9. You can roll back to the previous deployment if the current state of the deployment is not stable.
  10. You can scale up the deployment to manage the loads.
  11. You can pause the deployment if you are fixing something in between the deployment and then resume it after fixing it.
  12. You can clean up those replica sets which are older and no longer needed.

commands:

create deployment : kubectl apply -f my-deployment.yml        
get deployment: kubectl get deploy        

For ex, you might have added 2 replicas earlier and you need to scale them to 4, you can run below

scale deployment: kubectl scale --replicas=4 deployment my-deployment        
roll out deployment: kubectl rollout undo deployment deployment-name 
for ex: kubectl rollout undo deployment my-deployment        
delete deployment: kubectl delete -f my-deployment.yml        

Happy learning && thanks for your time in reading.

#kubernetesLearning #deployment #rollout #rollback



要查看或添加评论,请登录

Krishna Murthy的更多文章

  • Kubernetes Autoscaling

    Kubernetes Autoscaling

    “One part at a time, one day at a time, we can accomplish any goal we set for ourselves.” — Karen Casey For example:…

  • Kubernetes-Pod lifecycle

    Kubernetes-Pod lifecycle

    “I can't change the direction of the wind, but I can adjust my sails to always reach my destination.” — Jimmy Dean…

  • Kubernetes-configmap and secrets

    Kubernetes-configmap and secrets

    “When defeat comes, accept it as a signal that your plans are not sound, rebuild those plans, and set sail once more…

  • Kubernetes-Volumes

    Kubernetes-Volumes

    “I have a motto on my bedroom wall: ‘Obstacles are what you see when you take your eye off the goal.‘ Giving up is not…

  • Kubernetes networking-services

    Kubernetes networking-services

    Without goals, and plans to reach them, you are like a ship that has set sail with no destination.” — Fitzhugh Dodson…

  • Learning about scheduling nodes or pods

    Learning about scheduling nodes or pods

    We usually face challenges of scheduling pods and node when we were planning for Kubernetes cluster upgrade. By using…

  • How to Upgrade the CA Certificate for an RDS Instance Using Terraform

    How to Upgrade the CA Certificate for an RDS Instance Using Terraform

    Ensuring the security and reliability of your database instances is a crucial aspect of modern cloud infrastructure…

社区洞察