aws / aws-application-networking-k8s

A Kubernetes controller for Amazon VPC Lattice
https://www.gateway-api-controller.eks.aws.dev/
Apache License 2.0
175 stars 50 forks source link

Configurable target group port #619

Open johnstaf144 opened 7 months ago

johnstaf144 commented 7 months ago

Currently, all VPC Lattice target groups are created with the target group port as 80 which is not configurable.

Reference:

Could we change this so that we can configure the target group port, possibly using the TargetGroupPolicy. It could look something like:

kind: TargetGroupPolicy
metadata:
    name: test-policy
spec:
    targetRef:
        group: ""
        kind: Service
        name: my-parking-service
    port: 8080 # new attribute proposal

and if port is not supplied it can use the current default of 80 for backwards compatibility. If this proposal is accepted I'm happy to attempt a PR for the change.

Many thanks

erikfuller commented 6 months ago

Hi @johnstaf144, thanks for opening this issue.

The port used at target group creation is basically just a placeholder, it isn't actually used for routing traffic. When we register the targets, we specify the port that is actually used. This logic exists in model_build_targets.go.

Was there another reason behind needing to specify this port value?