ππ Day 58 DevOps Challenge - π Launching your Kubernetes Cluster with Deployment

Passionate software engineering student | DevOps enthusiast | Seeking innovation and excellence in software engineering! π¨βπ»
In the exciting world of Kubernetes (K8s), one of the fundamental concepts you'll encounter is Deployment. π οΈ But what exactly is a Deployment in K8s?
Understanding Deployment in K8s
A Deployment in Kubernetes provides a robust configuration for managing updates for Pods and ReplicaSets. It allows you to define a desired state, and the Deployment Controller ensures that the actual state of your application aligns with this desired state at a controlled pace. This controlled rate of change helps in maintaining stability during updates and scaling.
You can use Deployments to achieve various objectives, such as creating new replicas for scaling your application or replacing existing Deployments and adopting all their resources with new ones. The flexibility of Deployments is a powerful tool in managing your applications effectively. π§
Today's Task
Today, let's keep it simple yet impactful with a specific task.
For performing these tasks, ensure that you have Kubernetes/minikube installed on your local machine. Alternatively, you can use a cloud-based virtual machine such as an EC2 instance. If you haven't set up Kubernetes/minikube yet, you can refer to my previous blog π: Install Minikube on your local machine or AWS EC2 instance ππ οΈ



Task-1: Create a Sample Deployment with "Auto-healing" and "Auto-Scaling" Features
Your mission is to create a Deployment file that deploys a sample nginx on your Kubernetes cluster using the "Auto-healing" and "Auto-Scaling" features.
Steps to Accomplish the Task:
Create a Deployment File: On your EC2 instance where you've set up minikube, you'll need to create a file named
deployment.yaml. This file will define the desired state of your cluster.Below is the sample deployment configuration. You can copy this and paste it into your
deployment.yamlfile.apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80Note: Don't worry about memorizing every detail of the file configuration (e.g., pod.yml or deployment.yml). You can simply refer to provided examples and modify them according to your specific needs.


Apply the Deployment: Use the
kubectl applycommand to apply the Deployment configuration to your K8s (minikube) cluster. The command will look like this:kubectl apply -f deployment.yaml


This simple yet impactful task will not only enhance your understanding of Deployments but also add another valuable project to your resume. Let's get coding and make your resume shine! π
Closing Thoughts
Thanks for reading my learning journey! I appreciate your time and dedication. If you find any mistakes or have any feedback, feel free to drop a comment. Your engagement means a lot! π Don't forget to like and share this content to spread the knowledge. Let's connect on social media:
LinkedIn: Adarsh Jha π§βπ»
Twitter: Adarsh Jha
Instagram: ππππ«π¬π‘
GitHub: AdarshJha-1
Hashnode: AdarshJha
Hashnode Blogs: AdarshJha-Blogs
Happy learning and coding! Keep exploring the fascinating world of Kubernetes and beyond. π‘




