A Pod is the smallest configurable unit for running containers in Kubernetes. It includes the configuration a container needs; it can also contain multiple containers that share resources. You can create a Pod directly, but a Deployment is the usual choice when you need Kubernetes to manage several Pods. section 8.1.3 section 8.3.1
Run a first Pod
To run one NGINX container, save a YAML manifest as my-first-pod.yaml. Set apiVersion to v1, kind to Pod, metadata.name to first-pod-nginx, and spec.containers to a container named nginx using the nginx image. Run kubectl apply -f my-first-pod.yaml, then kubectl get pods to check that it was created. Run kubectl delete -f my-first-pod.yaml when you no longer need it. section 8.3.1
Listing 8.3 K8s YAML manifest for an NGINX Pod
apiVersion: v1
kind: Pod
metadata:
name: first-pod-nginx
spec:
containers:
- name: nginx
image: nginx
The complete minimal manifest shows where the Pod name and container image go. section 8.3.1
For multiple instances, put the Pod specification inside a Deployment template. The Deployment declares a replica count and matching labels; a Service can then distribute traffic to available, ready Pods. Deployment-managed Pods are interchangeable and ephemeral: if you delete one, Kubernetes creates another to restore the desired replica count. Find them by label rather than relying on a particular Pod name. section 8.3.3 section 8.4
A directly created, temporary Pod is useful for a quick test inside a cluster—for example, installing a PostgreSQL client to test a database connection. For resources you intend to provision repeatedly, use YAML manifests. section 8.4.3














