Kubernetes YAML explainer
Paste a Kubernetes manifest and read what each field means, with checks for selector mismatches, latest tags, missing limits and removed APIs.
Everything here runs in your browser. Nothing you type is sent to D's Labs or anyone else.
Keeps a number of identical Pods running from a template and replaces them gradually when the template changes (a rolling update).
warning — Container api uses the latest tag; pin a version so every node runs the same thing. spec.template.spec.containers[0].image
warning — Container api has no memory limit; one leak can starve the whole node. spec.template.spec.containers[0].resources
info — Container api has no resource requests, so the scheduler cannot place it sensibly. spec.template.spec.containers[0].resources
info — Set allowPrivilegeEscalation: false on api unless it needs setuid binaries. spec.template.spec.containers[0].securityContext
info — Nothing stops api running as root; add runAsNonRoot: true (and a runAsUser if the image needs one). spec.template.spec.containers[0].securityContext
info — Container api has no readinessProbe: it gets traffic as soon as it starts, ready or not. spec.template.spec.containers[0]
info — One replica means downtime whenever that Pod is replaced or its node goes away. spec.replicas
- apiVersion: apps/v1
- Which API group and version defines this kind. Old beta versions are removed in newer clusters.
- kind: Deployment
- The type of object.
- metadata.name: shop-api
- The object's name, unique among objects of this kind in its namespace.
- metadata.labels: {1 key}
- Key/value tags. Selectors in Services, Deployments and NetworkPolicies find objects by these.
- spec.replicas: 1
- How many Pods to keep running.
- spec.selector: {1 key}
- Which Pods this object manages or sends traffic to, by label.
- spec.selector.matchLabels: {1 key}
- The labels a Pod must carry to be selected. Must match the Pod template's labels.
- spec.template: {2 keys}
- The Pod template every replica is created from.
- spec.template.metadata.labels: {1 key}
- Labels each Pod gets — the selector must match them.
- spec.template.spec.containers: [1 item]
- The containers in each Pod.
- spec.template.spec.containers[0].name: api
- The container's name inside the Pod.
- spec.template.spec.containers[0].image: shop/api:latest
- The image to run. Pin a version tag or digest; `latest` changes under you.
- spec.template.spec.containers[0].ports: [1 item]
- Ports the container listens on (informational; Services do the exposing).
- spec.template.spec.containers[0].ports[0].containerPort: 8000
- A port the process listens on.
A stable name and virtual IP in front of the Pods its selector matches, load-balancing traffic to them.
No findings.
- apiVersion: v1
- Which API group and version defines this kind. Old beta versions are removed in newer clusters.
- kind: Service
- The type of object.
- metadata.name: shop-api
- The object's name, unique among objects of this kind in its namespace.
- spec.type: ClusterIP
- ClusterIP (inside the cluster only), NodePort (a port on every node), LoadBalancer (an external load balancer) or ExternalName.
- spec.selector: {1 key}
- Which Pods this object manages or sends traffic to, by label.
- spec.ports: [1 item]
- The ports the Service exposes.
- spec.ports[0].port: 80
- The port clients connect to on the Service.
- spec.ports[0].targetPort: 8000
- The port (number or name) on the Pod that traffic is sent to.
What it checks
Each document is parsed in your browser and its familiar fields are explained in plain English. The checks catch the mistakes that bite most often: a selector that does not match the Pod labels, images on latest, no memory limit, privileged containers, hostPath and hostNetwork, missing readiness probes, and API versions newer clusters have removed. It is a reading aid, not a validator for every field — kubectl apply --dry-run=server is the final word.