DEV Community

Cover image for Day 32 Task: Launching your Kubernetes Cluster with Deployment
On-cloud7
On-cloud7

Posted on

3 1 1 1

Day 32 Task: Launching your Kubernetes Cluster with Deployment

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 "Auto-healing" and "Auto-Scaling" feature

To deploy the sample ToDo app on Kubernetes using Deployment, follow these steps:

Create a YAML file named deployment.yml with the following content:

 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


Enter fullscreen mode Exit fullscreen mode

2.Apply the deployment to your k8s cluster by running:

 kubectl apply -f deployment.yml
Enter fullscreen mode Exit fullscreen mode

3.Verify that the Deployment is created by running:

 kubectl get deployments
Enter fullscreen mode Exit fullscreen mode

4.Verify that the Pods are running by running:

 kubectl get pods
Enter fullscreen mode Exit fullscreen mode

Conclusion:
In this blog post, we learned how to launch a Kubernetes cluster with Deployment, a configuration that allows us to manage updates to Pods and ReplicaSets. We also deployed a sample ToDo app on Kubernetes using Deployment and enabled auto-healing and auto-scaling for it.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (2)

Collapse
 
afoot profile image
afoot

Awesome, keep going!

Collapse
 
oncloud7 profile image
On-cloud7

thank you

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more