Setting EnvoyService to NodePort type has a bug when total number of k8s nodes > 16
Description:
When EnvoyService is set to type NodePort we are seeing the following error:
status.addresses: Too many. Must have at most 16 items
When the service is of type NodePort, the address is set to all of the node addresses, as seen here: https://github.com/envoyproxy/gateway/blob/c752b889e81190d8c4dd81eafb71dfa5e5110311/internal/gatewayapi/status/gateway.go#L73
Repro steps:
- Have a Kubernetes environment with > 16 nodes
- Set EnvoyService type to NodePort:
envoyService:
type: NodePort
- Read logs from envoy gateway
Environment: Gateway version: v1.0.1 Envoy version: v1.29
Logs:
2024-06-24T15:18:20.599Z ERROR provider kubernetes/status_updater.go:115 unable to update status {"runner": "provider", "name": "gateway", "namespace": "...", "error": "Gateway.gateway.networking.k8s.io "gateway" is invalid: status.addresses: Too many: 67: must have at most 16 items"}
this is due to the limit set in the CRD https://github.com/kubernetes-sigs/gateway-api/blob/c1b375bda97d344948a50ebd40814ffcd68b78ac/apis/v1/gateway_types.go#L641
to improve user experience, we should be limiting the value to 16 entries and appending the status message to mention that we did this
/assign