-
Notifications
You must be signed in to change notification settings - Fork 13
Support for non-http backends #41
Description
Hi,
We are exposing gRPC services through Traefik with the h2c protocol on the backends. Because of the logic in getValidInstances shown below, service instances that do not have an http endpoint are considered invalid:
traefik-extra-service-fabric/servicefabric.go
Lines 202 to 215 in 6e90a9e
| func getValidInstances(sfClient sfClient, app sf.ApplicationItem, service sf.ServiceItem, partition sf.PartitionItem) []sf.InstanceItem { | |
| var validInstances []sf.InstanceItem | |
| if instances, err := sfClient.GetInstances(app.ID, service.ID, partition.PartitionInformation.ID); err != nil { | |
| log.Error(err) | |
| } else { | |
| for _, instance := range instances.Items { | |
| if isHealthy(instance.ReplicaItemBase) && hasHTTPEndpoint(instance.ReplicaItemBase) { | |
| validInstances = append(validInstances, instance) | |
| } | |
| } | |
| } | |
| return validInstances | |
| } |
As a consequence, the gRPC service instances are not included when the configuration template is evaluated.
We have managed to work around this issue by first adding an additional "dummy" http endpoint to the services and then writing a custom configuration template that selects the "h2c" endpoint using the getNamedEndpoint template function.
Our workaround seems a bit fragile and it would be useful with a first order support for custom protocols - for example by using the traefik.protocol label on the service.