Pod is a single instance of an application.
kubectl run nginx --image nginx
Resume:
- Kubernetes Pod Basics:
- Kubernetes does not deploy containers directly; instead, it encapsulates them into "pods."
- A pod is the smallest Kubernetes object and represents a single instance of an application, typically containing one container.
- Scaling Applications:
- To handle increased load, add new pods (not containers within an existing pod).
- Scaling across nodes in a cluster is supported by deploying additional pods on new nodes if capacity on current nodes is insufficient.
- Multi-Container Pods:
- Although a pod usually has one container, it can contain multiple containers.
- Multi-container pods are rare and typically used for helper tasks, where containers need to share resources or communicate directly.
- Kubernetes Pod vs. Docker:
- In Docker, manually managing connections, storage, and scaling is necessary. Kubernetes automates this within pods.
- Pods share network and storage, creating and destroying containers in sync.
- kubectl Commands for Pods:
- Creating a pod:
kubectl run
command, with the -image
parameter specifying the Docker image (e.g., NGINX from Docker Hub).
- Listing pods:
kubectl get pods
shows all pods and their states (e.g., running or creating).
- External Access:
- Pods are initially inaccessible to external users. Later lectures cover exposing pods to external users through networking and services.