Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.

The objective of this section is to learn about application deployments, how it’s done with examples. We will deploy our app via the Kubectl CLI and configuration files.

To get the code follow the link given below :

Kubernetes Deployments

Now that we have a running Kubernetes cluster, we can deploy a containerized application on it. This can be achieved through use of Deployment configurations. The deployments instruct Kubernetes how to create and update instances of your application. Once a deployment has been created, the kubernetes master schedules mentioned application instances into individual Nodes in the cluster.

Deploying An App to Kubernetes

Kubernetes deployments can be managed via kubernetes command line interface kubectl. Kubectl uses the Kubernetes API to interact with the cluster. In this section we will look into some of the commands you will need to create deployments that run an application on the kubernetes cluster.

Create Nodejs Application

Now that we have established how we can manage deployments, let us create the application we will be deploying to our cluster. Create a folder in your workspace and addindex.js.

Create a Docker container image

Before we can make any deployments to our cluster we need to create an image we will be using. This image will contain the app we just built. In your current working directory, create a file named Dockerfile. A Dockerfile describes the image that you want to build. Images can be built by extending an existing image, for instance, our images will extend from Nodejs Image.

Create a Kubernetes Deployment

Kubernetes deployments are responsible for creating and managing pods — a kubernetes pod is a group of one or more containers, tied together for the purpose of administration and networking. Deployments check on the health of the pods and restart the pods’ container when it terminates. For this reason, deployments are the recommended way to manage the creation and scaling of pods.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store