A sleeping cat.

Kubernetes YAML Validator

Validate Kubernetes YAML manifests for syntax and common structural issues before applying resources to a Kubernetes cluster.

Kubernetes YAML Validator

Local processing

Parse Kubernetes YAML and check common manifest structure and configuration issues before using it with your cluster.

Runs in your browser

YAML Input

YAML

Supports multiple documents separated by ---

Tip: press Ctrl + Enter to validate.yaml / .yml
Examples
♥

ToolTunnel is free and ad-free

Your support helps us build more tools and improve the ones you already use.

♥Support

Related Tools

More tools you may find useful.

About this tool

ToolTunnel Kubernetes YAML Validator is a browser-based tool for parsing Kubernetes YAML manifests and checking common structural and configuration problems. It supports multiple YAML documents, reports YAML parsing errors with line and column information when available, and performs resource-specific checks for common Kubernetes objects such as Deployments, Services, Pods, ConfigMaps, and Secrets.

What Is a Kubernetes YAML Manifest?

Kubernetes resources are commonly described using YAML manifests. A manifest defines the desired configuration of an object such as a Deployment, Service, Pod, ConfigMap, Secret, Job, or other Kubernetes resource.

Because YAML is indentation-sensitive and Kubernetes resources follow specific structural conventions, a small syntax or configuration mistake can prevent a manifest from being parsed or accepted by Kubernetes.

What Does This Kubernetes YAML Validator Check?

The validator first parses the YAML and then performs additional checks based on the resource kind. It can process multiple YAML documents separated by the YAML document marker (---).

The checks are intended to catch common problems before you copy a manifest into kubectl, a deployment pipeline, GitOps workflow, or another Kubernetes management system.

  • YAML syntax and parsing errors
  • Missing or invalid apiVersion
  • Missing or invalid kind
  • Missing or invalid metadata.name
  • Invalid metadata.namespace values
  • Invalid metadata.labels and metadata.annotations structures
  • Deployment replica configuration
  • Deployment selector and pod template structure
  • Container names and images
  • Service ports and targetPort values
  • Pod container configuration
  • ConfigMap data and stringData structures
  • Secret data and stringData structures

Supported Kubernetes Resource Checks

The validator includes targeted checks for several commonly used Kubernetes resource kinds. These checks are designed to provide useful feedback without attempting to reproduce the entire Kubernetes API server validation process.

  • Deployment
  • Service
  • Pod
  • ConfigMap
  • Secret

YAML Parsing and Syntax Errors

Before resource-specific validation can occur, the YAML must be parsed successfully. YAML syntax errors can result from incorrect indentation, malformed mappings, invalid sequences, or other syntax problems.

When the YAML parser provides location information, the validator reports the affected line and column so you can locate the problem more quickly.

  • Incorrect indentation
  • Malformed YAML mappings
  • Invalid sequence structure
  • Missing or unexpected YAML syntax
  • Multiple-document parsing problems
  • Unexpected characters or malformed values

Deployment Validation

Deployments are one of the most common Kubernetes workload resources. The validator checks common Deployment structure including apiVersion, spec, selector, pod template, containers, and replica configuration.

It also checks that container names and images are present and that container-related fields such as ports, environment variables, commands, and arguments use the expected array structure.

  • Recommended apps/v1 apiVersion
  • Deployment spec structure
  • spec.replicas must be a non-negative integer when provided
  • spec.selector must be an object
  • spec.template must be an object
  • spec.template.spec must be an object
  • At least one container is required
  • Container name must be a non-empty string
  • Container image must be a non-empty string

Service Validation

For Kubernetes Services, the validator checks the common structure of the Service specification and validates service ports. It also checks selector and type fields when they are present.

  • Recommended v1 apiVersion
  • Service spec structure
  • Selector must be an object when provided
  • At least one service port is expected
  • Service ports must be integers
  • Ports must be between 1 and 65535
  • targetPort can be a number or string
  • protocol must be a string when provided
  • Service type must be a string when provided

Pod and Container Validation

Pod validation focuses on the core pod specification and its containers. The validator checks that a pod has a valid spec and at least one container.

Each container is checked for a required name and image. Common array-based fields are also checked for the expected structure.

  • Pod normally uses apiVersion v1
  • spec must be an object
  • At least one container is required
  • Container name is required
  • Container image is required
  • Container ports must be an array when provided
  • Container env must be an array when provided
  • Container command must be an array when provided
  • Container args must be an array when provided

ConfigMap and Secret Validation

ConfigMaps and Secrets commonly store configuration values and application data. The validator checks the structure of data and stringData fields when they are present.

It also reports an informational warning when neither data nor stringData is defined.

  • ConfigMap and Secret normally use apiVersion v1
  • data must be an object when provided
  • stringData must be an object when provided
  • A warning is reported when neither data nor stringData is present

Multiple YAML Documents

Kubernetes configuration files often contain multiple resources separated by --- markers. The validator supports multiple YAML documents and displays the validation result for each parsed resource separately.

Each document receives its own resource identification, issue list, and parsed structure so that problems can be associated with the correct manifest.

Validation Errors, Warnings, and Information

The validator separates findings into errors, warnings, and informational messages. Errors generally represent structural or value problems that should be corrected, while warnings highlight configurations that may need attention.

Informational messages can indicate that a resource kind does not currently have specialized checks implemented by the tool.

Common Kubernetes YAML Problems

  • Incorrect YAML indentation
  • Missing apiVersion
  • Missing kind
  • Missing metadata.name
  • Incorrect Deployment replica values
  • Missing Deployment containers
  • Missing container images
  • Invalid Service port numbers
  • Incorrect selector structure
  • Incorrect array fields such as env, ports, command, or args
  • Malformed ConfigMap or Secret data structures

Common Use Cases

  • Checking Kubernetes manifests before running kubectl apply
  • Debugging YAML copied from documentation or repositories
  • Reviewing Deployment and Service manifests
  • Checking manifests during Kubernetes development
  • Inspecting YAML before committing it to Git
  • Troubleshooting configuration used in CI/CD pipelines
  • Reviewing manifests used by GitOps workflows
  • Quickly checking a YAML file without installing additional tools

What This Validator Does Not Guarantee

Passing this validator does not guarantee that Kubernetes will accept or successfully deploy the resource. The Kubernetes API server performs additional validation that depends on the resource schema and Kubernetes version.

Admission controllers, admission policies, RBAC permissions, referenced resources, CRDs, namespace state, image availability, scheduling constraints, and cluster-specific configuration can introduce additional requirements.

This tool should therefore be treated as a fast pre-check rather than a replacement for kubectl validation, server-side validation, or testing against a real Kubernetes cluster.

Local Processing and Privacy

The validator processes YAML in your browser. The YAML is not uploaded to a backend service by this tool.

This can be useful when reviewing configuration files locally. However, you should still follow your organization's security policies when handling secrets, credentials, private configuration, or other sensitive Kubernetes data.

Frequently Asked Questions

▶What is a Kubernetes YAML Validator?

A Kubernetes YAML Validator parses Kubernetes YAML manifests and checks them for common syntax, structural, and configuration problems before they are used with Kubernetes.

▶Does this tool validate Kubernetes YAML syntax?

Yes. The tool first parses the YAML and reports YAML syntax errors. When available, parsing errors include the affected line and column.

▶Does this tool fully validate Kubernetes resources?

No. It performs targeted checks for common resource types and structures. It does not reproduce all Kubernetes API server, admission controller, cluster, or CRD validation.

▶Which Kubernetes resources are checked?

The current resource-specific checks cover Deployment, Service, Pod, ConfigMap, and Secret. Other resource kinds can still be parsed, but they may receive an informational message instead of kind-specific validation.

▶Can I validate multiple Kubernetes YAML documents?

Yes. Multiple YAML documents separated by --- are supported, and each parsed document is reported separately.

▶Why does the validator say metadata.name is required?

Kubernetes resources generally need a resource name under metadata.name so that the object can be identified. The validator checks that metadata.name exists and is a non-empty string.

▶Why is my Deployment invalid when replicas is a string?

The validator expects spec.replicas to be a non-negative integer when the field is provided. For example, replicas: 3 is valid for this check, while replicas: "three" is not.

▶Does the validator check container images?

Yes. For supported workload resources, containers are checked to ensure that a non-empty image value is provided.

▶Does the validator check Kubernetes API schemas?

Not completely. It performs selected structural and configuration checks rather than loading the complete Kubernetes OpenAPI schema for every resource and Kubernetes version.

▶Can I open a Kubernetes YAML file?

Yes. You can open a .yaml or .yml file directly from your device or drag and drop it into the input area.

▶Is my Kubernetes YAML uploaded to a server?

No. The validator processes the YAML locally in your browser and does not upload it to a backend service.

▶Can this replace kubectl apply validation?

No. It is intended as a convenient pre-check. Kubernetes server-side validation, admission policies, cluster configuration, permissions, referenced resources, and other runtime conditions can identify additional problems.

▶What does an informational message mean?

An informational message can indicate that the YAML parsed successfully but the resource kind does not currently have specialized validation checks implemented by this tool.