Skip to content

Container Run Time

🚀 Container Runtime & Kubernetes – Simple Notes

1. What is a Container Runtime?

  • A container runtime is the software that actually runs containers.
  • Examples:
  • Docker
  • containerd
  • rkt (now deprecated)

👉 Think:

“Runtime = engine that runs containers”


2. Early Kubernetes Design

  • Initially, Kubernetes was built only for Docker
  • Docker handled:
  • Image pulling
  • Container execution
  • Networking setup

👉 Simple memory:

Kubernetes + Docker were tightly coupled


3. Problem with Docker Dependency

  • Kubernetes depended only on Docker
  • Other runtimes (like rkt) could not integrate easily
  • Needed a standard interface

4. Solution: CRI (Container Runtime Interface)

  • Kubernetes introduced CRI
  • Purpose:
  • Allow multiple runtimes to work with Kubernetes
  • CRI acts as a bridge between Kubernetes and runtimes

👉 Memory trick:

CRI = “Common Runtime Interface”


5. OCI Standard (Industry Standardization)

  • OCI = Open Container Initiative
  • Defines standards for:
  • Container images
  • Runtime behavior

👉 Important:

  • Docker was not OCI initially
  • Later became OCI-compliant

👉 Memory:

OCI = “Rules for containers everywhere”


6. Move Away from Docker

  • Kubernetes removed direct Docker support
  • Reason:
  • Docker was not a true CRI runtime
  • Instead, Kubernetes supports:
  • containerd
  • CRI-O

👉 Key point:

Kubernetes doesn’t use Docker directly anymore


7. containerd (Default Runtime Today)

  • Extracted from Docker
  • Lightweight and OCI-compliant runtime

Tools in containerd:

  • ctr → low-level CLI
  • nerdctl → Docker-like CLI (easy to use)

👉 Memory:

containerd = “core Docker engine without extras”


8. Kubernetes CLI for Runtime – crictl

  • Kubernetes provides:
  • crictl
  • Used to interact with CRI runtimes

Example usage:

crictl ps

crictl images

👉 Memory:

crictl = “kubectl for container runtime”


🔄 Full Flow (Easy to Remember)

Kubernetes
CRI (interface)
containerd / CRI-O
Containers

🧠 Quick Revision Summary

  • Runtime → runs containers (Docker, containerd)
  • Kubernetes (early) → Docker only
  • CRI → allows multiple runtimes
  • OCI → standard rules
  • Docker removed → not CRI-native
  • containerd → main runtime now
  • Tools:
  • ctr, nerdctl → containerd
  • crictl → Kubernetes runtime interaction

⚡ Ultra-Short Memory Version

Docker → Initial runtime
CRI → Standard interface
OCI → Common standard
containerd → Current runtime
crictl → Debug runtime in Kubernetes

If you want, I can turn this into:

  • ✅ Flashcards for quick revision
  • ✅ Interview Q&A format
  • ✅ Diagram for visual learning

Just tell 👍