Amer Nureddin:
Hi guys again, I am trying to edit a deployment yaml file using (kubectl edit deployment xx) it opens the auto generated yaml file which is full of many fields etc…
now I am trying to add an affinity section but it throws this error:
deployments.apps “blue” was not valid:
# * <nil>: Invalid value: “The edited file failed validation”: [ValidationError(Deployment.spec.template.spec.affinity): unknown field “resources” in io.k8s.api.core.v1.Affinity, ValidationError(Deployment.spec.template.spec.affinity): unknown field “terminationMessagePath” in io.k8s.api.core.v1.Affinity, ValidationError(Deployment.spec.template.spec.affinity): unknown field “terminationMessagePolicy” in io.k8s.api.core.v1.Affinity]
#
when I edit, should I always clear the file and paste the simple version that we do normally? or it is ok to add on the autogenerated file and no need to clear it?