$devtoolkit.sh/examples/yaml/kubernetes-pod

Validate a Kubernetes Pod Manifest

Kubernetes manifests are complex YAML documents where a formatting error causes kubectl apply to reject the file or silently misinterpret the configuration. This example shows a Pod spec with resource limits, environment variables, liveness and readiness probes. Validating the YAML structure before applying to a cluster saves time and prevents misconfigured workloads from reaching production.

Example
apiVersion: v1
kind: Pod
metadata:
  name: web-api
  labels:
    app: web-api
    version: v2
spec:
  containers:
    - name: api
      image: myapp:2.1.0
      ports:
        - containerPort: 8080
      resources:
        requests:
          cpu: "100m"
          memory: "128Mi"
        limits:
          cpu: "500m"
          memory: "512Mi"
      livenessProbe:
        httpGet:
          path: /healthz
          port: 8080
        initialDelaySeconds: 10
[ open in YAML Validator → ]

FAQ

What is the difference between requests and limits in Kubernetes?
requests is the amount of CPU/memory the scheduler reserves for the pod. limits is the maximum it can use. A pod that exceeds its memory limit is killed; exceeding CPU limit throttles it.
What is a liveness probe?
A liveness probe tells Kubernetes whether the container is running correctly. If it fails, Kubernetes restarts the container. A readiness probe controls whether the pod receives traffic.
Should I use Pod directly or a Deployment?
Use a Deployment in production. Deployments manage replica sets, handle rolling updates, and restart pods that fail. Bare Pods are not rescheduled if the node fails.

Related Examples

/examples/yaml/kubernetes-podv1.0.0