Not able to create multiple backendRefs for same service listning on 2 different ports
chaitanyaavi opened this issue · comments
Not able to deploy service with 2 different backendRefs for the same service on 2 different ports.
Here is the HTTPRoute config I used:
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: backend-api-routes
namespace: backend
spec:
parentRefs:
- name: backend-gateway
kind: Gateway
namespace: default
sectionName: http
rules:
- backendRefs:
- name: apiserver
kind: Service
namespace: backend
port: 8088
matches:
- path:
type: PathPrefix
value: /graphql
- backendRefs:
- name: apiserver
kind: Service
namespace: backend
port: 8080
matches:
- path:
type: PathPrefix
value: /
This creates a target group with a single target for port 8088. If I need to change the name of the second Backend ref, how can I provide the service name for that reference?
This is a controller limitation due to it creating target groups with the same name even if ports are different. The current possible workaround is to create different (k8s) services when exposing multiple ports.
Besides, there is an active work of naming change on target groups (#425) so I will double check and post here if there is any behavior change.
We released EKS controller version v0.0.18 yesterday which contains a revised TG naming strategy to avoid conflicts. Target group names will no longer conflict across clusters for identical specs. Target group names now include a randomized suffix and all identification/deduplication is done through first class fields on the target group and tags.
Marking this issue as resolved. Thank you for you support.