Skip to content

HTTPProxy status update fails with "ports[].error: Required value" when using AWS NLB #7391

@joelp172

Description

@joelp172

Description

When using Contour with an AWS Network Load Balancer, the HTTPProxy status cannot be updated because the CRD schema marks the error field as required in status.loadBalancer.ingress[].ports[]. However, Contour doesn't set this field when there's no error, causing validation to fail.

Environment

Contour version: v1.33.1
Helm chart version: 0.2.1
Kubernetes version: 1.35
Cloud provider: AWS (EKS)
Load balancer type: NLB

Steps to Reproduce

  1. Deploy Contour with an AWS NLB service
  2. Create an HTTPProxy resource
  3. Check Contour logs for status update errors

Expected Behavior

HTTPProxy status.loadBalancer should be populated with the NLB hostname, allowing external-dns and other controllers to read the address.

Actual Behaviour

Contour logs show:

level=error msg="unable to update status" context=StatusUpdateHandler error="HTTPProxy.projectcontour.io \"contour-test-app\" is invalid: [status.loadBalancer.ingress[0].ports[0].error: Required value, status.loadBalancer.ingress[0].ports[1].error: Required value, <nil>: Invalid value: null: some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]" kind=HTTPProxy name=contour-test-app namespace=contour-system

The HTTPProxy status shows:

status:
  loadBalancer: {}  # Empty - never populated

Root Cause

The HTTPProxy CRD schema has error marked as required:

{
  "required": ["error", "port", "protocol"]
}

Path: spec.versions[0].schema.openAPIV3Schema.properties.status.properties.loadBalancer.properties.ingress.items.properties.ports.items.required

The error field should be optional - it's only needed when there's an actual error to report.

Workaround

Patch the CRD to make error optional:

kubectl patch crd httpproxies.projectcontour.io --type=json -p='[
  {
    "op": "replace",
    "path": "/spec/versions/0/schema/openAPIV3Schema/properties/status/properties/loadBalancer/properties/ingress/items/properties/ports/items/required",
    "value": ["port", "protocol"]
  }
]'

Suggested Fix

In the HTTPProxy CRD definition, change the required fields for ports.items from:

required:
  - error
  - port
  - protocol

To:

required:
  - port
  - protocol

Impact

  • HTTPProxy resources don't get their status.loadBalancer populated
  • external-dns cannot create DNS records for HTTPProxy resources
  • Any tooling that relies on HTTPProxy status is broken

Additional Context

This issue appears to affect NLB services specifically because they include ports in the LoadBalancer status. Classic ELBs or ALBs may not trigger this issue if they don't include port information.
The standard Kubernetes Ingress resource is unaffected - only HTTPProxy has this validation issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/needs-triageIndicates that an issue needs to be triaged by a project contributor.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions