Skip to content
This repository was archived by the owner on Aug 4, 2022. It is now read-only.
This repository was archived by the owner on Aug 4, 2022. It is now read-only.

Support for non-http backends #41

@mortenab

Description

@mortenab

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions