Kubernetes Manifest Validator API
Validate Kubernetes YAML against the official schemas of 8 recent versions, flag removed APIs and lint resources, probes, image tags and security.
Send one or more YAML (or JSON) documents as yaml, a file or a raw body; List kinds are expanded. Each object is validated against the OpenAPI schema of the chosen Kubernetes version (the last 8 minor releases, latest patch, default the newest; /v1/k8s-validate/versions lists them) with field types, required fields, enums and — in strict mode (default) — unknown fields such as a misspelled imagePullPolice. null values (e.g. creationTimestamp: null from kubectl) are ignored.
An apiVersion / kind not served by that version is reported as not_served with the release that removed it and the replacement (for example batch/v1beta1 CronJob → batch/v1 since 1.25), or the versions that serve it. Unknown kinds (custom resources) are skipped.
lint (default on) checks workloads (Deployment, StatefulSet, DaemonSet, Job, CronJob, Pod…): image without tag or :latest, missing CPU / memory requests and memory limit, missing readiness / liveness probes, privileged containers, privilege escalation, running as root, hostNetwork / hostPID / hostIPC, hostPath volumes, dangerous capabilities, literal secrets in env, single replica, NodePort services. Schemas come from the Kubernetes OpenAPI spec (Apache-2.0) and are refreshed weekly.
Markdown · OpenAPI · Postman · llms.txt
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
yaml | body | string | yes | One or more YAML / JSON documents (or a file / raw body). | |
version | body|query | string | no | Kubernetes minor version, e.g. 1.35 (default: newest bundled). | |
strict | body|query | boolean | no | true | Reject fields not in the schema. |
lint | body|query | boolean | no | true | Run best-practice checks. |
Example
curl -X POST "https://apibox.io.vn/v1/k8s-validate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"yaml":"apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: web\nspec:\n replicas: 2\n selector: {matchLabels: {app: web}}\n template:\n metadata: {labels: {app: web}}\n spec:\n containers:\n - name: web\n image: nginx:latest\n ports: [{containerPort: \"80\"}]\n---\napiVersion: batch/v1beta1\nkind: CronJob\nmetadata: {name: report}\n","version":"1.37"}'const res = await fetch('https://apibox.io.vn/v1/k8s-validate', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"yaml": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: web\nspec:\n replicas: 2\n selector: {matchLabels: {app: web}}\n template:\n metadata: {labels: {app: web}}\n spec:\n containers:\n - name: web\n image: nginx:latest\n ports: [{containerPort: \"80\"}]\n---\napiVersion: batch/v1beta1\nkind: CronJob\nmetadata: {name: report}\n",
"version": "1.37"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/k8s-validate",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"yaml": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: web\nspec:\n replicas: 2\n selector: {matchLabels: {app: web}}\n template:\n metadata: {labels: {app: web}}\n spec:\n containers:\n - name: web\n image: nginx:latest\n ports: [{containerPort: \"80\"}]\n---\napiVersion: batch/v1beta1\nkind: CronJob\nmetadata: {name: report}\n", "version": "1.37"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/k8s-validate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"yaml":"apiVersion: apps/v1\\nkind: Deployment\\nmetadata:\\n name: web\\nspec:\\n replicas: 2\\n selector: {matchLabels: {app: web}}\\n template:\\n metadata: {labels: {app: web}}\\n spec:\\n containers:\\n - name: web\\n image: nginx:latest\\n ports: [{containerPort: \\"80\\"}]\\n---\\napiVersion: batch/v1beta1\\nkind: CronJob\\nmetadata: {name: report}\\n","version":"1.37"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"kubernetes_version": "1.37",
"release": "v1.37.2",
"strict": true,
"valid": false,
"summary": {
"objects": 2,
"valid": 0,
"invalid": 1,
"not_served": 1,
"skipped": 0,
"lint_errors": 0,
"lint_warnings": 6
},
"results": [
{
"document": 0,
"kind": "Deployment",
"api_version": "apps/v1",
"name": "web",
"status": "invalid",
"errors": [
{
"path": "spec.template.spec.containers.0.ports.0.containerPort",
"message": "type \"string\" is invalid. Expected \"integer\"."
}
],
"lint": [
{
"rule": "image-latest",
"severity": "warning",
"message": "container \"web\": image tag :latest is not reproducible; pin a version or digest",
"path": "spec.template.spec.containers[0].image"
},
{
"rule": "resources-requests",
"severity": "warning",
"message": "container \"web\" has no CPU / memory requests (scheduling and QoS are guessed)",
"path": "spec.template.spec.containers[0].resources.requests"
},
"…"
]
},
{
"document": 1,
"kind": "CronJob",
"api_version": "batch/v1beta1",
"name": "report",
"status": "not_served",
"errors": [
{
"path": "apiVersion",
"message": "batch/v1beta1/CronJob is not served by Kubernetes 1.37 (removed in 1.25; use batch/v1)"
}
],
"available_in": [],
"use_api_version": [
"batch/v1"
]
}
]
}
Use cases
- Check manifests or Helm template output before kubectl apply
- Find APIs that break when upgrading a cluster to a new Kubernetes version
- Review security basics (root, privileged, hostPath) in pull requests
- Validate YAML generated by scripts or no-code tools
FAQ
Does it support CRDs?
Custom resources are reported as skipped; only built-in Kubernetes kinds are validated.
Can I validate Helm charts?
Render them first (helm template) and send the output; templates with {{ }} are not valid YAML.
Is my manifest stored?
No. It is validated in memory; secrets in it are never logged or kept.
Related APIs
UUID Generator
Generate up to 1,000 UUID v4, time-ordered UUID v7, ULID, Nano ID or random hex IDs per request. Secure randomness, optional uppercase.
⏱Cron Expression Parser
Validate a cron expression and get its next run times in any timezone, with a plain-English description. Supports 5, 6 and 7-field cron syntax.
🕒Time & Timezone Converter
Get the current time in any timezone, convert between timezones and Unix timestamps (seconds or ms), with UTC offset and weekday for up to 30 zones.