kubectl neat: clean exported YAML

Strip status, managedFields, cluster-assigned IPs and default values from kubectl get -o yaml, and get a manifest you can commit.

Runs locally. Nothing you paste leaves this tab.

Remove

    What gets removed

    • Always: status, uid, resourceVersion, generation, creationTimestamp, managedFields, ownerReferences, the last-applied-configuration annotation, and labels the controllers add (pod-template-hash, controller-uid, job-name…).
    • Defaults: only when the value is exactly the default, such as dnsPolicy: ClusterFirst, terminationGracePeriodSeconds: 30, a 25%/25% rolling update or probe timings of 1s/10s/1/3. A value you changed is kept.
    • Assigned values: a Service’s clusterIP and nodePort, a pod’s nodeName and a PVC’s volumeName. Keep them only if you re-apply to the same cluster and need the same addresses.

    Export the controller, not its pods: a Deployment, StatefulSet or Job manifest recreates the pods.

    kubectl get deploy,svc,ingress,configmap -n prod -o yaml > live.yaml

    View this tool’s source · Report a problem

    Support on Ko-fi