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:

  • pod lifetime
  • pod phrases
StateDes
Pendingbeing scheduled or images being pulled from registry
Running:after successfull attached to a node
Faileda container terminated with failture and wont be restarting
Succeededall containers finished running successfully and they wont be restarting
Unknownstate cant be retrieved
CrashLoopBackOffone 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