Back to Tech Corner
DevOps

Mini Article – Simple Pod - Oct 2022

Simple Pod

A Pod is the lowest compute unit and individual object we can work with in Kubernetes. It can be a single container, but often, it will consist of a primary application container and one or more supporting containers.

Below is an example of a simple pod manifest in YAML format. Note the apiVersion (it must match the existing API group), the kind (the type of object to create), the metadata (at least a name), and its spec (what to create and parameters), which define the container that actually runs in this pod:

apiVersion: v1
kind: Pod
metadata:
    name: testpod
spec:
    containers:
    - image: nginx
      name:  emma

You can use the kubectl create command to create this pod in Kubernetes. Once it is created, you can check its status with kubectl get pods. The output is not shown:

$ kubectl create -f testpod.yaml

$ kubectl get pods

# show pod details in json format
$ kubectl get pod testpod -o json

# show pod details in YAML format
$ kubectl get pod testpod -o yaml