Get error unknown field serviceName in io.k8s.api.networking.v1.IngressBackend when switch from v1beta1 to v1 in Kubernetes Ingress
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
This error appears when an Ingress manifest is updated to networking.k8s.io/v1 but still uses the old v1beta1 backend shape. In the stable v1 API, serviceName and servicePort no longer exist directly under backend, so Kubernetes rejects the manifest as having unknown fields.
Why the Error Happens
In v1beta1, an Ingress backend often looked like this:
That schema is no longer valid in networking.k8s.io/v1. The backend object was restructured so that the service reference now lives under backend.service.
When you keep the old field names after switching the apiVersion, the API server sees serviceName and servicePort as unknown fields and fails validation.
The Correct v1 Backend Shape
In v1, the same backend must be written like this:
The important changes are:
- '
serviceNamebecomesbackend.service.name' - '
servicePortbecomesbackend.service.port.numberorbackend.service.port.name' - '
pathTypeis required for each path'
Those are the changes behind this specific validation error.
Named Ports Also Changed Shape
If your Service uses a named port instead of a numeric port, the v1 syntax still uses the nested service.port object.
This is a common migration detail. People often replace serviceName and forget that servicePort also changed shape, especially for named ports.
pathType Is Not Optional in v1
Another migration problem is forgetting pathType. The backend fields may be corrected, but the manifest still fails because v1 requires a path type such as:
- '
Prefix' - '
Exact' - '
ImplementationSpecific'
For example:
So the migration is not just a field rename. It is a schema update.
Default Backend Migration
If your old Ingress used a top-level backend, that field also changed shape in v1.
Old style:
New style:
That matters because some manifests mix both rule-based backends and a default backend, and both areas need to be migrated correctly.
Validate the Manifest Before Applying
A safe workflow is to run client-side or server-side validation before deploying the changed Ingress.
If the cluster version and schema do not match your manifest, those commands usually reveal the problem early. They are especially useful during API migrations, because the syntax may look plausible while still being invalid for the target resource version.
Migration Checklist
When moving from v1beta1 to v1, check all of these together:
- '
apiVersionchanged tonetworking.k8s.io/v1' - '
backend.serviceNamereplaced bybackend.service.name' - '
backend.servicePortreplaced bybackend.service.port.numberor.name' - '
pathTypeadded to each path' - '
defaultBackendupdated if present' - '
ingressClassNamereviewed if the old manifest relied on annotations only'
That full list prevents the common "fixed one field, hit the next validation error" cycle.
Common Pitfalls
One common mistake is changing only the apiVersion and assuming the old backend structure still works. It does not.
Another pitfall is migrating serviceName but forgetting that servicePort also moved into a nested port object.
A third issue is correcting the backend and then hitting a second error because pathType was not added. The v1 schema requires more than one change.
Finally, do not assume old blog posts or examples are safe to copy into a modern cluster. Many of them still show v1beta1 syntax that is now invalid.
Summary
- The error happens because
networking.k8s.io/v1no longer acceptsserviceNameandservicePortdirectly underbackend. - In
v1, usebackend.service.nameandbackend.service.port.numberor.name. - Add
pathTypefor every path when migrating tov1. - Update top-level default backends too if your Ingress uses them.
- Validate the manifest with
kubectl --dry-runbefore applying it to the cluster.
Related reading
- Get pods on nodes with certain label
- Get Ready status using kubectl -ojsonpath
- Get replica set of the deployment
- Get Service selectors with K8s Python client
- Get filename and path from URI from mediastore
- Get hosted zone for cloudfront distribution
- Get the image and SHA image ID of images in pod on Kubernetes deployment
- get vs. list in Kubernetes RBAC

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.