Launching Kubernetes Cluster with Deployment

·

2 min read

Launching Kubernetes Cluster with Deployment

Let's understand Deployment & how to make replica sets in K8s.

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:

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

  • add a deployment.yml file.

  • apply the deployment to your k8s (minikube) cluster by command kubectl apply -f deployment.yml

  1. First, add a deployment.yaml file inside the "k8s-projects" folder. This file will pull the image from DockerHub.

  2. Then we apply the deployment to the K8s cluster by using kubectl apply -f deployment.yaml command.

  3. We can view the deployments by using kubectl get deployments.

  4. Even if we delete one pod, it will auto-healed automatically within no time. These show an auto-healing feature of the Kubernetes cluster.

  5. This is optional we can see the running container in this way inside the docker with the help of minikube ssh command.

Reference: Kubernetes-Deployments


Thanks for reading my articles.

Also for your valuable time.

Keep learning and Stay healthy.