Skip to content

Mutations of HTTPRoutes belonging to other controllers #1244

@imax9000

Description

@imax9000

Ingress controller is unable to co-exist with any other Gateway API controller in the same cluster: it updates status of all routes regardless of their Gateway's class name. This results in two controllers hammering the HTTPRoute's status with constant updates, with ingress controller complaining about overloaded envoy and OOMing after a few minutes.

Exhibit A:

o.HTTPRoutesByGateway = make(map[refKey][]httpRouteInfo)
for i := range hrl.Items {
hr := &hrl.Items[i]
o.OriginalHTTPRouteStatus = append(o.OriginalHTTPRouteStatus,
httpRouteAndOriginalStatus{route: hr, originalStatus: hr.Status.DeepCopy()})
ensureRouteParentStatusExists(hr, c.ControllerName)
for j := range hr.Spec.ParentRefs {
pr := &hr.Spec.ParentRefs[j]
key := refKeyForParentRef(hr, pr)
if _, ok := o.Gateways[key]; ok {
o.HTTPRoutesByGateway[key] = append(o.HTTPRoutesByGateway[key],
httpRouteInfo{hr, pr, &hr.Status.Parents[j]})
}
}
}

On line 74 it adds an incomplete status to the HTTPRoute struct, after adding a pointer to it to OriginalHTTPRouteStatus. That loop is supposed to filter out routes that belong to other controllers, but, unfortunately, that is done later on line 78.

Exhibit B:

if err := c.updateModifiedHTTPRouteStatus(ctx, o.OriginalHTTPRouteStatus); err != nil {

That happens in the function processGateways that is called right after fetchObject (which is Exhibit A), overwriting route's status with an incomplete stub.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions