Day 32 Task: Launching your Kubernetes Cluster with Deployment

Day 32 Task: Launching your Kubernetes Cluster with Deployment

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.

Task-1:

Create one Deployment file to deploy a sample todo-app on K8s using the "Auto-healing" and "Auto-Scaling" feature

Auto-Healing ensures that if a Pod fails or terminates unexpectedly, Kubernetes automatically replaces it to maintain the desired number of replicas.

Auto-Scaling allows you to automatically adjust the number of replicas based on resource utilization, ensuring that your application can handle increased load without manual intervention.

Add a deployment.yml file

This manifest defines a Deployment named "todo-app" that manages two replicas of the ToDo application. Each replica runs in a Pod with a single container named "todo," which uses the "agnes1/node-todo" Docker image and listens on port 8000.

To list a deployment:

Apply the deployment to your k8s (minikube) cluster by command

kubectl apply -f deployment.yml

kubectl get deployments

Thank you for reading!

Happy Learning!