Kubernetes·Kubernetes from first pod to production app

Pods

Run a container in a pod and inspect its logs and status.

Intermediate 13 min read Lesson 2 of 300 Challenge included
What you will be able to do
  • A pod wraps one or more containers.
  • Pods are disposable; use controllers for real workloads.
  • Use kubectl logs and describe first.
  • Set resource requests and limits.

In plain English

A pod is the smallest deployable unit and usually holds one container. Pods are ephemeral: do not rely on their names or local storage. Use kubectl logs, describe and exec to debug.

pod.yamlYAML
apiVersion: v1
kind: Pod
metadata:
  name: web
spec:
  containers:
    - name: web
      image: nginx:1.27-alpine
      ports:
        - containerPort: 80
      resources:
        requests:
          cpu: 50m
          memory: 64Mi
        limits:
          memory: 128Mi
Your turn

Add a resource limit

Easy

Add a memory limit of 128Mi to a container.

YAML · starter
resources: {}
Check your understanding before moving on.
Knowledge checkQuestion 1

What is the smallest deployable unit in Kubernetes?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Deployments
Lesson 2 of 300 · 0% of course