- What is Deployment in k8s
A Deployment provides a configuration for 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 replicas for scaling, or to remove existing Deployments and adopt all their resources with new Deployments.
Deployment is a resource object that provides declarative updates to applications. It allows you to describe an application's life cycle, such as which images to use for the app, the number of replicas, and how to update them, in a declarative way. Deployments are part of the Kubernetes "Apps" API group and serve as a higher-level abstraction over pods.
Some features of deployment are:
Automated Deployment: Automation tools and scripts are used to streamline the deployment process, reducing the risk of human error and increasing efficiency.
Rollback : In case of deployment failures or issues, a well-defined rollback procedure is essential to revert to the previous working version.
Scaling: The ability to scale the application horizontally (adding more servers) or vertically (increasing server resources) is important to handle varying workloads.
Monitoring and Logging: Real-time monitoring and logging tools are essential to track application performance, detect issues, and collect data for analysis.
Continuous Integration and Continuous Deployment (CI/CD): Implementing CI/CD pipelines automates the deployment process, allowing for frequent and predictable releases.
Task1:
Create one Deployment file to deploy a sample todo-app on K8s using "Auto-healing" and "Auto-Scaling" feature.
Create a deployment.yml file.
The number of replicas specified is 3 (Auto-scaling). Even if one of the pod goes down, it will deploy a new pod thus maintaining the required number of replicas (Auto-healing).
Step2. Create the deployment.yml with the following command
kubectl apply -f deployment.yml
Hence we have created our deployment.yml file. So a small project we have made like how to write a yaml manifest for creating deployment file.
Thank you all for taken out time to read this article so far. Hope you find the post useful. Kindly share your valuable feedback.
Kavita Pant