Table of Contents

spec

spec defines the desired state of the object.

This is the most important part of any Kubernetes YAML.

What it contains

Depends on the object:

Example (Pod)

spec: containers: - name: nginx image: nginx

Example (Deployment)

spec: replicas: 3 selector: matchLabels: app: web

Real-world analogy

spec = “what you want the system to achieve”

Example:

Key idea

spec is the instruction set for Kubernetes reconciliation loop