How to convert json to a kubernetes yaml manifest
- Step 1Export the live object from kubectl — Run kubectl get deployment my-app -o json > deployment.json to export a live manifest, or use the Kubernetes API directly to fetch the resource as JSON.
- Step 2Strip runtime fields before converting — For GitOps use, remove status, managedFields, and resourceVersion from the JSON before converting — these are runtime fields that should not be committed. Use the JSON Key Filter tool to strip those keys first.
- Step 3Convert to YAML — Paste the cleaned JSON and click Convert. The output is properly formatted YAML with consistent 2-space indentation matching Kubernetes convention.
- Step 4Commit to your GitOps repository — Save the output as the resource filename (e.g. manifests/deployment.yaml) and commit to your GitOps repository for ArgoCD or Flux to reconcile against the cluster.
Frequently asked questions
Will JSON null values cause problems in the Kubernetes YAML?+
JSON null values are converted to YAML null literals. Kubernetes tolerates null for optional fields, but some fields should be omitted entirely rather than set to null. Review null-valued keys in the output and remove any that the Kubernetes API would reject.
How are Kubernetes integer values like port numbers handled?+
JSON integers convert to unquoted YAML integers, which is correct for Kubernetes — port numbers and replica counts must be integers, not quoted strings. Boolean values (true/false) are also preserved as unquoted YAML booleans.
Is the cluster JSON — including any secret data — transmitted to JAD Apps?+
No. Conversion runs entirely in your browser using js-yaml. Live object JSON, including any encoded secret data or cluster-specific configuration, is 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.