A default backend is the fallback service for an Ingress request that matches no host or path rule. Without one, the request normally returns 404 Not Found; with one, the Ingress forwards the request to the configured service. section 12.2.4 section 12.7
Route unmatched requests to a custom 404 service
Set spec.defaultBackend.service to the service name and port, then create that Service and a backing Pod. For example, the fun404 Pod can return status 404 with the message “This isn't the URL you're looking for.” A request such as curl api.example.com/unknown-path can then produce that response. The default backend may also forward unmatched requests to an ordinary application service. section 12.2.4
Listing 12.5 Specifying the default backend in the Ingress object
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kiada
spec:
defaultBackend: #1
service: #1
name: fun404 #1
port: #1
name: http #1
rules:
...
Inspect the Ingress manifest showing defaultBackend.service.name and defaultBackend.service.port alongside ordinary routing rules. section 12.2.4
Some ingress implementations supply a default-http-backend service when no explicit default backend exists, but its presence is not guaranteed. An Ingress containing only a default backend can forward every request to that service. section 12.2.4
