How to convert kubernetes yaml to json
- Step 1Copy the manifest YAML — Paste a single Kubernetes resource YAML or a multi-document YAML separated by --- lines. The converter handles Deployment, Service, ConfigMap, Ingress, and any custom resource definition type.
- Step 2Convert and review the JSON structure — The JSON output mirrors the Kubernetes object model exactly. Check that apiVersion, kind, metadata, and spec are all top-level keys matching the API spec for that resource type.
- Step 3Validate against the Kubernetes schema — Paste the JSON into a Kubernetes JSON Schema validator or into the JSON Validator tool to catch missing required fields like spec.selector before applying to a cluster.
- Step 4Use in your controller or API call — Pass the JSON to kubectl apply --filename - via stdin, use it in a client-go UnstructuredJSON call, or use it as a test fixture for a custom controller unit test.
Frequently asked questions
How are Kubernetes multi-document YAML files handled?+
YAML files with multiple documents separated by --- are converted to a JSON array where each element is one Kubernetes object. If you need each document as a separate JSON file, split them at the --- separator before converting.
Will YAML anchors and aliases work correctly?+
Yes. The converter resolves YAML anchors (&anchor) and aliases (*alias) before producing JSON, so the output is fully dereferenced with all shared blocks expanded inline. This is particularly useful for Helm and Kustomize overlays that use YAML merge keys.
Is the manifest content — including secret values — sent to JAD Apps?+
No. YAML parsing runs entirely in your browser using js-yaml. Manifest content including environment variables, secret references, and internal service names are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.