Understanding Kubernetes pods
Kubernetes pods form the basic building block of a Kubernetes application. A pod contains one or more containers, and all containers within a pod are always scheduled in the same host. Usually, there is a single container within a pod, but there are use cases where you might want to schedule multiple containers in a single pod.
It takes a while to digest why Kubernetes started with the pod's concept in the first place instead of using containers, but there are reasons for that, and you will appreciate this as you gain more experience with the tool. For now, let's look at a simple example of a pod and how to schedule it in Kubernetes.
Running a pod
We will start by running an NGINX container in a pod using simple imperative commands. We will then look at how we can do it in a declarative fashion.
To access the resources for this section, cd
into the following:
$ cd ~/modern-devops/ch4/pod/
To run a pod with a single NGINX container...