Skip to content

Pods

A Pod is the basic execution unit of a Kubernetes application–the smallest and simplest unit in the Kubernetes object model that you create or deploy. A Pod represents processes running on your Cluster.

A Pod encapsulates an application’s container (or, in some cases, multiple containers), storage resources, a unique network IP, and options that govern how the container(s) should run. A Pod represents a unit of deployment: a single instance of an application in Kubernetes, which might consist of either a single container or a small number of containers that are tightly coupled and that share resources.

Resources

  • About Pods


    Learn more about the basics of pods and how they work.

    Getting started

  • Cluster Configuration for Pods


    Configure your cluster to work for your specific needs.

    Learn more

  • Pod Autoscaling


    Use a horizontal pod autoscaler (HPA) to specify how OCP should automatically scale up or down your deployment.

    Learn more

  • Pod Overview


    Learn more about the basics of pods and how they work.

    Getting started

  • Pod Lifecycle


    Read about the lifecycle process for pods and what each phase means.

    Learn more

  • Pod Usage


    How do you use pods? Read about it here.

    Learn more

References

apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
  labels:
    app: myapp
spec:
  containers:
    - name: myapp-container
      image: busybox
      command: ["sh", "-c", "echo Hello Kubernetes! && sleep 3600"]

Create Pod using yaml file

oc apply -f pod.yaml

Get Current Pods in Project

oc get pods

Get Pods with their IP and node location

oc get pods -o wide

Get Pod's Description

oc describe pod myapp-pod

Get the logs

oc logs myapp-pod

Delete a Pod

oc delete pod myapp-pod

Create Pod using yaml file

kubectl apply -f pod.yaml

Get Current Pods in Project

kubectl get pods

Get Pods with their IP and node location

kubectl get pods -o wide

Get Pod's Description

kubectl describe pod myapp-pod

Get the logs

kubectl logs myapp-pod

Delete a Pod

kubectl delete pod myapp-pod

Activities

Task Description Link
Try It Yourself
Creating Pods Create a Pod YAML file to meet certain parameters Pod Creation