What are these f: f: when you describe an object? How we can avoid these garba . . .

Roshan Ranasinghe:
what are these f: f: when you describe an object?
How we can avoid these garbage ?

managedFields:
- apiVersion: apps/v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:http://kubectl.kubernetes.io/last-applied-configuration|kubectl.kubernetes.io/last-applied-configuration: {}
f:labels:
.: {}
f:app: {}
f:spec:
f:progressDeadlineSeconds: {}
f:replicas: {}
f:revisionHistoryLimit: {}
f:selector:
f:matchLabels:
.: {}
f:app: {}
f:strategy:
f:rollingUpdate:
.: {}
f:maxSurge: {}

Apaar Sharma:
kubectl get po nginx -o yaml | grep -v “f:”

Roshan Ranasinghe:
thanks @Apaar Sharma … why those are coming in that way?

Apaar Sharma:
these are the managed fields, they are suppressed in the output in the newer versions.

Roshan Ranasinghe:
ok… thanks @Apaar Sharma

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

Roshan Ranasinghe:
@Mohamed Ayman thanks