Day 32 Task: Launching your Kubernetes Cluster with Deployment
Congratulations on completing Day 31 of your 90daysofdevops challenge! Today, we'll delve deeper into Kubernetes (K8s) by learning about Deployments and practicing launching a Kubernetes Cluster with Deployment.
What is Deployment in Kubernetes?
A Deployment in Kubernetes provides a way to manage and update a set of Pods. It provides a declarative way to define the desired state of your application's Pods and ReplicaSets. The Deployment Controller then works to change the actual state of the Pods to match the desired state defined in the Deployment.
Today's Task: Launching a Kubernetes Cluster with Deployment
Today's task is designed to be simple yet practical. We'll create a Deployment file to deploy a sample todo-app on Kubernetes using "Auto-healing" and "Auto-Scaling" features.
Task 1: Creating a Deployment File
领英推荐
kubectl apply -f deployment.yml
Sample deployment.yml file:
apiVersion: apps/v1
kind: Deployment
metadata:
name: todo-app
labels:
app: todo
spec:
replicas: 2
selector:
matchLabels:
app: todo
template:
metadata:
labels:
app: todo
spec:
containers:
- name: todo
image: rishikeshops/todo-app
ports:
- containerPort: 3000
Explanation of the Deployment file:
Conclusion
By completing this task, you've gained hands-on experience in deploying applications on Kubernetes using Deployments. This is a valuable skill that can enhance your resume and showcase your proficiency in Kubernetes.
Happy Learning!
DevOps Engineer at Capgemini
11 个月Happy Learning!!