I don't want to copy `fields` while saving the pod content to a file therefore h . . .

Manoj GR:
I don’t want to copy fields while saving the pod content to a file therefore how do we get rid of from it?

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2021-06-19T09:17:08Z"
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:spec:
        f:ports:
          .: {}
          k:{"port":3306,"protocol":"TCP"}:
            .: {}
            f:port: {}
            f:protocol: {}
            f:targetPort: {}
        f:selector:
          .: {}

Mohamed Ayman:
These additional fields in the new version of Kubernetes.
You can only exclude some of these fields using grep command to decrease the file:

kubectl get pod nginx -o yaml | grep -v “f:” > pod.yaml

Manoj GR:
Thanks @Mohamed Ayman

Vagif Gafar:
I use kubectl get pod nginx -o yaml | grep -v {} > mypod.yaml