Deploy a Pod in Kubernetes with only One Command

Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. It builds on 15 years of experience with managing containers at Google.

Kubernetes provides a way to manage your application’s infrastructure in a declarative manner. The goal is to provide users with the ability to define their desired state configuration in code, rather than manually configuring all aspects of their environment through manual commands or shell scripts.

The following post will help you deploy a pod in Kubernetes with only one command line!

What is a pod in kubernetes

A Pod consists of one or more containers that belong to the same application. A pod can be defined through code rather than manually configuring all aspects of your environment with manual commands or shell scripts. It consists of one or more containers, an IP address, port mappings, volume definitions, and other metadata.

Pods are the smallest deployable compute units that can be developed and managed in Kubernetes.

Deploy a Pod

Let’s go ahead and deploy a pod using kubectl and the command below.

kubectl run nginx --image=nginx

This is the most basic form of the run command.

To check the status of the pod, run.

kubectl get pods

If you would like to review the pod configuration (IP address, Namespace, etc.), use the describe command.

kubectl describe pod nginx

To delete the pod, we use the delete command.

kubectl delete pod nginx

1 comment

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.