Description:
- Kubernetes Object
- Smallest unit in Kubernetes that you can create or deploy.
- A wrap around one or a set of containers
- If many containers share the same storages, they can be the same pod
- Containers share network namespace, IP, network ports
- Containers in a pod are in same namespace, communicated with eachother over
localhost
Pod lifecycle:
| State | Des |
|---|
| Pending | being scheduled or images being pulled from registry |
| Running: | after successfull attached to a node |
| Failed | a container terminated with failture and wont be restarting |
| Succeeded | all containers finished running successfully and they wont be restarting |
| Unknown | state cant be retrieved |
| CrashLoopBackOff | one of the containers in the pod exited unexpectedly even after it was restarted |
Init containers
Side car containers:
- the secondary containers that run along with the main application container within the same pod
- such as logging, monitoring, security, proxy, reverse proxy or data synchronization
API
apiVersion: v1
kind: Pod
metadata:
name: ...
spec:
containers:
- name:
image:
imagePullPolicy:
command:
args: ["sleep", "60"] # or in multiple lines
workingDir
ports:
containerPort
hostIP
hostPort
name
protocol
env