Day 32 Task: Launching your Kubernetes Cluster with Deployment
Unlocking the Power of Kubernetes Deployment for Seamless Application Management
๐ถ 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" features
Prerequisites Make instances of t2.medium.
# First all update system and install Docker sudo apt-get update sudo apt-get install docker.io -y sudo usermod -aG docker $USER && newgrp docker # To install Minikube & Kubectl curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube sudo snap install kubectl --classic minikube start --driver=docker
Add a deployment.yml file (the sample is kept in the folder for your reference)
Clone this repository to your local machine:
git clone https://github.com/Chandreshpatle28/django-todo-cicd-Jenkins.git
sudo docker build . -t chandreshpatle28/django-todo:latest
Login to your Docker Hub by using your username and password and push your image to Docker Hub.
apply the deployment to your k8s (minikube) cluster by command
kubectl apply -f deployment.yml
-
To validate the functionality of the auto-healing feature, deliberately delete one of the pods.
In conclusion, launching your Kubernetes cluster with deployment capabilities opens up a world of possibilities for managing and scaling your containerized applications. With Kubernetes' robust features and flexibility, you can confidently orchestrate your workloads, automate scaling, and ensure high availability. Whether you're deploying a simple application or a complex microservices architecture, Kubernetes provides the tools and control you need to streamline your operations and deliver reliable services to your users. So, embrace Kubernetes and unlock the full potential of container orchestration in your infrastructure.
Happy Learning :)
Stay in the loop with my latest insights and articles on cloud โ๏ธ and DevOps โพ๏ธ by following me on Hashnode, LinkedIn (https://www.linkedin.com/in/chandreshpatle28/), and GitHub (https://github.com/Chandreshpatle28).
Thank you for reading! Your support means the world to me. Let's keep learning, growing, and making a positive impact in the tech world together.
#Git #Linux Devops #Devopscommunity #90daysofdevopschallenge #python #docker #Jenkins #Kubernetes