Port Discovery should use Service ports if available
Currently the Port Discovery feature uses the ContainerPorts on Pods, but it should use the Service ports instead when available.
There are no services. Flagger expects a deployment and nothing more see https://docs.flagger.app/faq#kubernetes-services
Which means Flagger will break communication in some existing working scenarios, when a Service is defined and ContainerPorts are not complete. If services A and B are working as they are, there should be a way to add a Canary without requiring they be modified. Flagger should have a way to refer to an existing service rather than assume one does not exist.
Also will Flagger be able to support multiple service ports in traffic shifting, for example if I want 5% of HTTP traffic and 5% of GRPC traffic to go to my Canary since my service has endpoints for both?
Which means Flagger will break communication in some existing working scenarios, when a Service is defined and ContainerPorts are not complete.
Well that's bad practice in my opinion, fixing the container ports before creating the canary should solve it.
Also will Flagger be able to support multiple service ports in traffic shifting, for example if I want 5% of HTTP traffic and 5% of GRPC traffic to go to my Canary since my service has endpoints for both?
That's why the port discovery exists, to shifting traffic across all ports. Not all providers have support for multiple ports, but works with Istio and Linkerd.
Whether it is bad practice or not, it is valid practice that works today.
Which means Flagger will break communication in some existing working scenarios, when a Service is defined and ContainerPorts are not complete.
Well that's bad practice in my opinion, fixing the container ports before creating the canary should solve it.
Also will Flagger be able to support multiple service ports in traffic shifting, for example if I want 5% of HTTP traffic and 5% of GRPC traffic to go to my Canary since my service has endpoints for both?
That's why the port discovery exists, to shifting traffic across all ports. Not all providers have support for multiple ports, but works with Istio and Linkerd.
Using gateway (other than mesh off course) force the destination to use the port. In my use case, HTTP traffic is allowed through ingress-gateway and internal service to service traffic is GRPC.
@stefanprodan does the port discovery still work for linkerd? I set portDiscovery: true but the new generated services only had the port set in spec.service, and other ports were missing.