diff --git a/pkg/k8s/watchers/watcher.go b/pkg/k8s/watchers/watcher.go index a2bdc13d33c1f..f5f6c06a1808b 100644 --- a/pkg/k8s/watchers/watcher.go +++ b/pkg/k8s/watchers/watcher.go @@ -940,12 +940,12 @@ func stripServiceProtocol(svc *k8s.Service) *k8s.Service { svc = svc.DeepCopy() for _, port := range svc.Ports { - port.Protocol = "NONE" + port.Protocol = "ANY" } for _, nodePort := range svc.NodePorts { for _, port := range nodePort { - port.Protocol = "NONE" + port.Protocol = "ANY" } } @@ -957,7 +957,7 @@ func stripEndpointsProtocol(endpoints *k8s.Endpoints) *k8s.Endpoints { for _, backend := range endpoints.Backends { for _, port := range backend.Ports { - port.Protocol = "NONE" + port.Protocol = "ANY" } } diff --git a/pkg/loadbalancer/loadbalancer.go b/pkg/loadbalancer/loadbalancer.go index a59862f3ba586..0bc75f211cfaf 100644 --- a/pkg/loadbalancer/loadbalancer.go +++ b/pkg/loadbalancer/loadbalancer.go @@ -233,6 +233,8 @@ func (s ServiceFlags) UInt16() uint16 { const ( // NONE type. NONE = L4Type("NONE") + // ANY type. + ANY = L4Type("ANY") // TCP type. TCP = L4Type("TCP") // UDP type. @@ -529,6 +531,8 @@ func NewL4Type(name string) (L4Type, error) { switch strings.ToLower(name) { case "none": return NONE, nil + case "any": + return ANY, nil case "tcp": return TCP, nil case "udp": @@ -549,7 +553,7 @@ func NewL4TypeFromNumber(proto uint8) L4Type { case 132: return SCTP default: - return NONE + return ANY } }