Kubernetes YAML Validator

Paste or drop a YAML manifest and find out whether it is valid, and if not, the exact line and column with the reason in plain language. Then the Kubernetes-specific checks: deprecated APIs, invalid names, and the values YAML quietly changes on you.

Paste below, or drop a file anywhere on this panel

Or drop a file anywhere on this panel. Nothing is uploaded: the analysis runs in this tab.

The answer appears here

Paste on the left and press Validate manifest. Nothing leaves this tab.

Examples

Real input you can load into the tool above. Each one shows a different thing going wrong, because that is what the tool is for.

A default-secure audit

A working Deployment and everything a hardened cluster will reject about it

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  template:
    spec:
      containers:
        - name: app
          image: api:latest

No namespace

A manifest that applies to whichever namespace happens to be current

apiVersion: v1
kind: Service
metadata:
  name: api
spec:
  selector:
    app: api
  ports:
    - port: 80

Common mistakes

These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.

  1. Omitting the namespace

    The manifest applies to whichever namespace kubectl currently points at, which is how something lands in the wrong one.

    Instead:Set metadata.namespace, or apply with -n explicitly.

  2. Leaving allowPrivilegeEscalation unset

    It defaults to true, so a process can gain privileges through setuid binaries. Restricted Pod Security admission rejects it.

    Instead:Set securityContext.allowPrivilegeEscalation: false.

  3. Using :latest in a Deployment

    The image is not pinned, so a rollout can pull something different and a rollback cannot reproduce the old one.

    Instead:Pin a tag, and a digest where you can.

What it checks

Validity first, because a manifest that will not parse is the urgent problem and every parser reports it badly. Then the things that parse fine and still go wrong.

Syntax errors, with the line and column

The parse error in plain language, with an excerpt and a caret under the exact character. Bad indentation, tabs, unclosed quotes, duplicate keys, a stray colon in an unquoted value: each gets an explanation of the likely cause rather than the parser's own wording.

Whitespace and encoding

Tabs in indentation (which YAML forbids outright), indentation that is not a multiple of the file's own step, indentation that jumps a level, trailing whitespace, Windows line endings, a byte order mark, a missing final newline, and control characters that arrive invisibly by pasting from a terminal.

Values that change meaning

Unquoted NO, yes, on and off become booleans in the YAML 1.1 parsers Kubernetes uses. 0644 becomes the number 420. A chart_version of 1.10 becomes 1.1 and the zero is gone. These parse fine and go wrong later, which is the worst kind.

Objects that will not apply

Missing apiVersion or kind, objects with no name, names that are not valid DNS subdomains (uppercase and underscores are the usual culprits), and pod templates with no containers or no image.

Removed and deprecated APIs

extensions/v1beta1, apps/v1beta1, policy/v1beta1, batch/v1beta1, autoscaling/v2beta2 and the rest, each with the version that removed it and what to migrate to. These are the manifests that break during a cluster upgrade rather than at review time.

And, once it is valid, what it does

Privileged containers, hostPath mounts, containers that can run as root, secrets pasted as literal env vars, wildcard RBAC, and the missing requests and limits that make a cluster bill larger than it needs to be. Filter these out by severity if you only came for the syntax.

A manifest is not a cluster

This checks the file you paste. A running cluster contains rather more than that: workloads deployed by a Helm chart nobody maintains, a namespace created for a proof of concept two years ago, node pools sized for a traffic peak that never came back.

It also cannot see what the file does not say. Whether a NetworkPolicy exists, whether the ServiceAccount this pod uses is bound to something powerful, whether the image tag you pinned has a critical CVE, and whether the nodes it lands on are half empty. Those answers live in the cluster.

Our scanner connects with a read-only ServiceAccount and answers them, alongside the cost of every node, volume and load balancer keeping the cluster alive.

What is in a Kubernetes manifest?

Every Kubernetes object, whatever it is, has the same four top-level keys. Once that shape is clear, the difference between a Deployment and a CronJob is only what goes inside spec, and most manifest errors turn out to be one of a small set of structural mistakes rather than anything to do with the workload itself.

Four keys, always the same four

apiVersion says which API group and version this object belongs to. kind is the type. metadata carries the name, namespace and labels. spec is the desired state, and it is the only part whose shape depends on the kind. Anything the cluster reports back appears under status, which you never write yourself.

apiVersion: apps/v1        which API, and which version of it
kind: Deployment           what type of object
metadata:                  name, namespace, labels, annotations
  name: api
spec:                      desired state: shape depends on kind
  replicas: 2

apiVersion is the one that breaks on upgrade

API versions graduate from alpha to beta to stable, and the older names are removed after a deprecation period. A manifest written against extensions/v1beta1 stopped applying at Kubernetes 1.16, and networking.k8s.io/v1beta1 Ingresses stopped at 1.22. The manifest is still valid YAML and the cluster simply refuses it, which is why a file that worked for years fails immediately after an upgrade.

apps/v1                  Deployment, StatefulSet, DaemonSet
batch/v1                 Job, CronJob
networking.k8s.io/v1     Ingress, NetworkPolicy
v1                       Pod, Service, ConfigMap, Secret: core group

Selectors and labels have to agree

A Deployment does not own its Pods directly. It creates a ReplicaSet, which finds Pods by matching labels, and the link between them is spec.selector.matchLabels matching spec.template.metadata.labels exactly. Get them out of step and the Deployment either creates Pods it does not recognise and keeps making more, or is rejected outright, and on an existing Deployment the selector is immutable, so the fix is to delete and recreate it.

spec:
  selector:
    matchLabels:
      app: api          <-- these two must match exactly
  template:
    metadata:
      labels:
        app: api        <-- or the Deployment owns nothing

Multiple documents in one file

Three dashes on their own line separate documents, which is how a Deployment, a Service and an Ingress travel together in one file. The separator is YAML, not Kubernetes, so each document is parsed independently: a syntax error in the third one does not stop the first two from being read, and a stray separator produces an empty document that some tools reject and others silently skip.

More kubernetes tools

Kubernetes YAML Generator Answer a few questions, get a manifest Kubernetes Rollout & Probe Timing Restart loops, capacity dips and stuck drains Kubernetes Service Checker Will this Service have any endpoints? Kubernetes Network Policy Viewer What can reach what, and what just broke Kubernetes Manifest Diff What actually changed Kubernetes Resource Calculator What these manifests actually reserve Kubernetes RBAC Viewer Who can actually do what Kubernetes Deployment Generator See the capacity dip before you deploy Kubernetes Service Generator port, targetPort, and which one you meant Kubernetes StatefulSet Generator Stable names, and volumes that outlive you Kubernetes QoS Class Calculator And where you sit in the eviction order Kubernetes Node Capacity Planner Allocatable is not capacity Kubernetes Max Pods per Node Calculator The ENI limit, not the 110 default Kubernetes Label Selector Tester Which key failed, not just that one did Kubernetes Taint & Toleration Tester Tolerations permit, they do not attract Kubernetes Resource Name Validator RFC 1123 subdomain, label, or 1035 Kubernetes Label & Annotation Validator Why your image tag is not a legal label Kubernetes CrashLoopBackOff Guide The status is a timer, not a cause Kubernetes TLS Certificate Decoder When it expires, and what it covers Kubernetes ServiceAccount Token Decoder Bound or legacy, and when it dies Kubernetes imagePullSecret Generator The registry URL nobody gets right Kubernetes cert-manager Certificates Issuer scope, and the rate limit that costs a week Kubernetes Flux HelmRelease Generator With the source it cannot work without Kubernetes Helm Chart Generator Chart.yaml, values, and working templates Kubernetes Argo CD Application Generator The defaults that are off, turned on Kubernetes Ingress Generator pathType, and the TLS secret that fails quietly Kubernetes HPA Generator Why it says unknown and never scales Kubernetes SecurityContext Generator Pod level, container level, and which wins Kubernetes Probe Generator How long it gets to start before liveness kills it Kubernetes PVC Generator Access modes your storage can actually do Kubernetes ResourceQuota Generator And the LimitRange that stops it breaking deploys Kubernetes CronJob Generator The fields that decide whether it runs Kubernetes NetworkPolicy Generator With the DNS rule already in it Kubernetes RBAC Generator And what it actually grants Kubernetes PodDisruptionBudget Generator Can this budget ever be satisfied? Kubernetes API Deprecation Checker What breaks on the next upgrade Kubernetes Kubeconfig Viewer Read it without handing it to anyone Kubernetes Quantity Parser What 512Mi, 100m and 1e3 actually mean Kubernetes Multi-Document YAML Splitter One file per object, in apply order Kubernetes .env to ConfigMap & Secret Split the credentials out on the way Kubernetes Secret Decoder See what is actually in there Kubernetes Ingress to Gateway API Which annotations silently stop working Kubernetes Manifest Visualizer What points at what, and what points at nothing Kubernetes Patch Tester Which --type, and what it deletes Kubernetes kubectl JSONPath Tester kubectl's dialect, not generic JSONPath Kubernetes Node Affinity Tester Required excludes, preferred only scores Kubernetes Helm Values Diff A missing key is a third value Kubernetes Pod and Service CIDR Fixed at cluster creation Kubernetes Secret Encoder base64 is not encryption Kubernetes API Version Checker Will this apply on that cluster Kubernetes Go Template Tester Go truthiness is not JavaScript's Kubernetes Cluster Cost Estimator At your rates, not a price table Kubernetes Kustomize Build Transformers run in kustomize's order Kubernetes Helm Chart Validator version is SemVer, appVersion is not

Elsewhere on the site