How to find non-portable fields from running resources configuration?

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version: v1.12.8-gke.10 on GCP


I’m doing application migration now. The thing I do is to grab all configurations of related resources and then deploy them to a new cluster. After getting information from shell command kubectl get <resource> -o yaml, I noticed that there is a lot of information that my deploy yamls don’t have.

I deleted ‘.spec.clusterIP, .metadata.uid, .metadata.selfLink, .metadata.resourceVersion, .metadata.creationTimestamp, .metadata.generation, .status, .spec.template.spec.securityContext, .spec.template.spec.dnsPolicy, .spec.template.spec.terminationGracePeriodSeconds, .spec.template.spec.restartPolicy’ fields. I’m not sure is there other fields that will influence the new deployment I need to delete? Is there a way to find all non-portable fields that I can delete?