What is Deployment in K8s?
In Kubernetes "deployment" refers to a Kubernetes resource and a declarative way to manage the deployment of applications or services in a cluster.
A Kubernetes Deployment is responsible for defining and managing the desired state of a set of replica Pods.
Here are the key aspects of a Kubernetes Deployment:
Desired State
Rolling Updates and Rollbacks
Scaling
High Availability
Self-healing
Task-1: Create one Deployment file to deploy a sample todo-app on K8s using the "Auto-healing" and "Auto-Scaling" feature.
step 1: Setup the k8s cluster with master node and worker node.
Here we are trying to configure the deployment for the container todo-app in todo-deployment.yml
Image is taken from the docker-hub sonalsona/to-do-app
Exposed on the port 3000, with 2 replicas.
step2: Create the deployment using kubectl apply -f todo-deployment.yml
step3: Scale the replicas of deployment if required..
Here i have scaled the replicas to 5, using kubectl scale --replicas=5 deploy/todo-deployment.yml
I hope you find the blog post helpful! If you do, don't forget to like ๐, comment ๐ฌ, and share ๐ข it with your friends and colleagues.