Loading validator...

How to Validate Kubernetes YAML - Step by Step Guide

Step 1

Input Your Kubernetes YAML

Copy your Kubernetes manifest YAML and paste it into the left editor panel. The validator supports all Kubernetes resource types including Deployments, Services, Pods, ConfigMaps, Secrets, Ingress, StatefulSets, DaemonSets, and more. You can validate single resources or multiple resources in one YAML file.

Multi-document support: The validator handles YAML files with multiple resources separated by ---
From any source: Paste from kubectl output, Helm templates, or existing manifest files
Try the sample: Click "Sample" to see how the validator detects common issues

Example: Kubernetes Deployment Manifest

Here's a typical Kubernetes Deployment YAML ready for validation:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.21
        ports:
        - containerPort: 80
Step 2

Automatic Validation

The validator runs automatically as you type! It performs multiple checks including YAML syntax validation, Kubernetes schema validation, required field checks, and best practice recommendations. It identifies issues like missing required fields, invalid values, and security concerns.

Syntax check: Validates YAML syntax and structure for parse errors
Schema validation: Ensures resources have required fields like apiVersion, kind, and metadata
Best practices: Checks for resource limits, labels, annotations, and security settings

Example: Common Issues Detected

Here are typical errors the validator catches:

Missing required field: metadata.name

Every Kubernetes resource needs a name in the metadata section.

Invalid apiVersion for Deployment

Deployments require 'apps/v1', not just 'v1'.

No resource limits specified

Without limits, pods can consume all available node resources.

Step 3

Review Errors, Warnings & Suggestions

The validator categorizes feedback to help you fix issues efficiently. Review the results panel to understand what needs attention.

Errors (red): Critical issues that will prevent deployment - must be fixed before applying
Warnings (yellow): Best practice violations that may cause problems - should be addressed
Suggestions (gray): Optional improvements for production readiness and reliability

Example: Validation Results

The validator provides clear feedback with errors, warnings, and suggestions:

✓ YAML is Valid!
All required fields present. Your manifest is ready to deploy.
⚠ Warning
No resource limits defined. Consider adding memory and CPU limits.
Suggestions
Add liveness and readiness probes for better health monitoring.
Step 4

Download and Deploy

Download the validated YAML using the Download button. Save it to your project and deploy using kubectl apply -f your-manifest.yaml. Make sure to fix any errors identified by the validator before deploying.

Test deployment: Use kubectl apply --dry-run=client to test locally first
Check permissions: Ensure you have proper RBAC permissions for the resources you're deploying
Monitor deployment: Use kubectl get pods -w to watch your deployment progress

Example: Deploy Your Validated Manifest

After validation, deploy using these kubectl commands:

# Test locally first (dry run)
$ kubectl apply --dry-run=client -f deployment.yaml

# Apply to your cluster
$ kubectl apply -f deployment.yaml
deployment.apps/nginx-deployment created

# Watch deployment status
$ kubectl rollout status deployment/nginx-deployment
deployment "nginx-deployment" successfully rolled out

Frequently Asked Questions

What does the Kubernetes YAML validator check?

The validator performs comprehensive checks including YAML syntax validation, Kubernetes schema validation (apiVersion, kind, metadata), required field verification, resource limit recommendations, security best practices, and label/annotation guidelines. It validates all Kubernetes resource types like Deployments, Services, Pods, ConfigMaps, Secrets, and more.

Can I validate multiple Kubernetes resources in one YAML file?

Yes! The validator fully supports multi-document YAML files. Simply separate your resources with --- and the validator will check each resource individually, reporting issues for each one separately. This is useful when validating complete application deployments with multiple components.

Does the validator work with Helm templates or Kustomize?

The validator checks standard Kubernetes YAML manifests. For Helm charts, you'll need to render the template first using helm template and then validate the output. For Kustomize, run kubectl kustomize to generate the final YAML. You can also use our Helm to Kubernetes converter.

What's the difference between errors, warnings, and suggestions?

Errors are critical issues that will prevent deployment (like missing required fields or invalid syntax). Warnings are best practice violations that won't block deployment but should be addressed (like missing resource limits). Suggestions are optimization tips to improve your manifests (like adding health probes or using specific image tags).

Is this validator equivalent to kubectl apply --dry-run?

The validator performs similar client-side checks for syntax and schema validation. However, kubectl apply --dry-run=server also checks against your actual cluster (RBAC permissions, existing resources, admission controllers). Use this validator for quick offline validation, then test with kubectl apply --dry-run=server before actual deployment.

Can I use this for production Kubernetes manifests?

Absolutely! The validator checks against official Kubernetes specifications and industry best practices. It's perfect for validating manifests before committing to git, in CI/CD pipelines, or while developing locally. However, always test in a non-production environment first.

Is the Kubernetes validator free to use?

Yes, completely free with no limitations! Validate unlimited Kubernetes manifests, no registration required, no file size restrictions. Use it as much as you need for your DevOps workflows.