I was trying to deploy a manifest through the Kubernetes manifest task but the task failed with the following error message:
error: error validating "/home/vsts/work/_temp/Ingress_tags-api-ingress_1622817055216": error validating data: [ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field "serviceName" in io.k8s.api.networking.v1.IngressBackend, ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field "servicePort" in io.k8s.api.networking.v1.IngressBackend]; if you choose to ignore these errors, turn validation off with --validate=false
Before I was using the Kubectl task which didn’t complain at all!?
The Kubernetes manifest task validates the manifest before it deploys it (which is in fact a good thing). So let’s have a look what is wrong with the manifest I try to deploy…
Here is the original manifest file:
The problem is that I’m still using the beta syntax for the ingress controller where my apiversion is pointing to v1. In v1 the syntax changed to specify the service Port and Name. Let’s fix this: