Pods
Pods are the smallest unit of compute in Kubernetes.
Pods can contain one or more containers in them - usually one container. The additional containers can be helper containers. Containers in the same pod share resources like network, storage, etc.
# To get pods
kubectl get pods
# To run a a pod from an image
kubectl run nginx --image=nginx
Paths into this note
5 notes lead here
-
A pod can have one or more containers running in it. If it runs multiple containers, there are primarily three different patterns:
-
Preemption specifies whether removing a pod with lower pod priority than the one it is trying to schedule will allow this one to run. If such a pod is found, it is evicted to make way for the higher priority pod.
-
Priority indicates the importance of a pod relative to others.
-
Static pods are managed by kubelet on a specific node, unlike regular pods which are managed by the control plane, based on files kept in the pod manifest directory. The kubelet scans the directory periodically and creates and deletes the pods based on if a file is added or removed. The kubelet also restarts the pod if it fails for example.
-
Why do we use this? In scenarios where we want to use for example nodeSelector with pods to specify where it may be able to run.