Export live resource as YAML
Current live state with managed fields stripped; useful as a base
kubectl get deployment/<name> -n <ns> -o yaml
More kubectl commands
-
kubectl delete pod <name> -n <ns> --grace-period=0 --forceRemove a Terminating pod immediately (use with caution)
-
kubectl cp <ns>/<pod>:/remote/path ./local-pathExtract a file from a running container
-
kubectl cordon <node>Mark node as unschedulable — no new pods land here
-
kubectl drain <node> --ignore-daemonsets --delete-emptydir-dataGracefully evict all pods before maintenance
-
kubectl edit deployment/<name> -n <ns>Open resource in $EDITOR; changes applied on save