gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Setting EnvoyService to NodePort type has a bug when total number of k8s nodes > 16

Open ryanhristovski opened this issue 1 year ago • 2 comments

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:

  1. Have a Kubernetes environment with > 16 nodes
  2. Set EnvoyService type to NodePort:
    envoyService:
      type: NodePort
  1. 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"}

ryanhristovski avatar Jun 24 '24 15:06 ryanhristovski

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

arkodg avatar Jun 24 '24 20:06 arkodg

/assign

sanposhiho avatar Jun 30 '24 15:06 sanposhiho