Kubernetes Deployment Spec

It mainly consists of three components:

  1. Metadata: It consists of the name and labels for the configuration file. The labels are used for establishing the connection between deployment and services.
  2. Specification: It consists of information regarding the number of replicas, selector labels, and template that is the blueprint for pods. The template itself is like a configuration file for pods and consists of metadata and specification for pods that stores information regarding the containers to be used in the pod, the image to be used for building the container, and the name and ports of the container.
  3. Status: This component is automatically generated and added by Kubernetes. This is the basis of the self-healing feature of Kubernetes. If the desired status and actual status of a deployment do not match Kubernetes fixes the pod and matches it with the desired status.

What is Kubernetes Deployment?

Kubernetes is an open-source Container Management tool that automates container deployment, container scaling, descaling, and container load balancing (also called as container orchestration tool). It is written in Golang and has a huge community because it was first developed by Google and later donated to CNCF (Cloud Native Computing Foundation). Deployment is an abstraction layer over pods. It is like a blueprint for creating pods. 

Similar Reads

Kubernetes Deployment

Kubernetes deployment is a high-level resource object by which you can manage the deployment and scaling of the applications while maintaining the desired state of the application. You can scale the containers with the help of Kubernetes deployment up and down depending on the incoming traffic. If you have performed any rolling updates with the help of deployment and after some time if you find any bugs in it then you can perform rollback also. Kubernetes deployments are deployed with the help of CLI like Kubectl it can be installed on any platform....

Kubernetes Deployment Spec

It mainly consists of three components:...

Kubernetes Deployment YAML

We will be using Minikube to use Kubernetes on our local machine. The Deployment configuration file for Nginx will be:...

Updating a Kubernets Deployment

To update a Kubernetes deployment we can simply update its config file using 2 methods:...

Rolling Back a Kubernets Deployment

In kubernetes deployment, you can revert back to the previous version of the application if you find any bugs in the present version. It will help you to reduce the problems which are facing by the end users in the current version or updated version of the application....

Checking the Rollout History of a Kubernets Deployment

Rollout history can be seen by using the following command....

Command to Scale a Kubernets Deployment

Scaling the deployment can be done in many ways we can do it by using the following command....

Pausing and Resuming a rollout of a Kubernets Deployment

You can pause the deployments which you are updating currently and resume the fallout updates for deployment when you feel that the changes are made correctly you can use the following command to pause the rollouts....

Kubernets Deployment Status

The deployment will pass different stages while it was in deploying. Each stage will say the health of the pods and shows us if any problems are arising....

Progressing Kubernets Deployment

If any deployment is in progress it is meant to be that deployment is in the stage of updating or creating a new replicaset. Following are some of the reasons that deployment is in progress....

Complete Kubernets Deployment

The following conditions must be satisfied to mark deployment as completed....

Failed Kubernets Deployment

Deployment may fail for several reasons when you try to deploy its newest ReplicaSet it may be in an incomplete position forever. This can cause for different reasons following are the reasons....

Kubernets Canary Deployment

The canary deployment will make sure that the deployment is going to content fifty percent of replicas are updated and fifty percent of replicas are older versions the replicas which are updated will be available for some of the end users and based upon their reviews we can replace all the replicas. If the reviews are positive you can update the remaining replicas if the feedbacks are bad then you can roll back to the previous version immediately....

Benefits of Kubernetes Deployments

Kubernetes Deployment helps in Container Orchestration that is managing the containers in pods. Enhances microservice architecture. Auto-scaling Automated Rollouts and Rollbacks Load Balancing...

Use Cases of Kubernetes Deployments

Rollout a ReplicaSet: A Kubernetes deployment generates a replica set a pod that contains information regarding the number of pos to be generated in the background. Declaring a New State of Pods: On updating pod template spec a new replica set is created and deployment moves pods from the old replica set to the new replica set. Scaling: Deployment can be configured to scale up to facilitate more load. Status of Deployment: It can be used to check if the deployment is stuck somewhere by matching the current status with the desired status. Cleaning up old Replica Sets that are no more required....

ReplicaSets vs Deployments

ReplicaSet Deployments ReplicaSet will ensure that the desired no.of pods are matching the specified no.of pods as mentioned in the yaml file Deployment is an advanced replication set that will manage the lifecycle of pods. ReplicaSet is not suitable for applications that are going to have rolling updates and rollbacks. Deployment supports the rolling update and rollbacks. Internally replica set will take care of pods and pods will take care of containers Internally deployment is going to take care of replica set and the replica set will take care of the pod....

FAQs On Kubernetes Deployment

Is Kubernetes a Container or VM?...