Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetcher generating duplicate routers & services #5

Closed
tony-gamble-asos opened this issue Nov 24, 2021 · 4 comments
Closed

Fetcher generating duplicate routers & services #5

tony-gamble-asos opened this issue Nov 24, 2021 · 4 comments

Comments

@tony-gamble-asos
Copy link

tony-gamble-asos commented Nov 24, 2021

The fetcher appears to be generating duplicate routers and services for every router and service defined as part of a single application.

See below example of dynamically generated config whereby routers and service config differs only by name.

http:
  middlewares:
    sf-stripprefixregex_nonpartitioned:
      stripPrefixRegex:
        regex:
        - ^/[^/]*/[^/]*/*
  routers:
    fabric-Application2-Web1-http-defaultEP:
      entryPoints:
      - websecure
      middlewares:
      - sf-stripprefixregex_nonpartitioned
      rule: PathPrefix(`/WeatherForecast`)
      service: fabric-Application2-Web1-http-defaultEP
      tls:
        options: "false"
    fabric-Application2-Web1-http-defaultEP-861ef74e-6895-4f76-b4d0-d257f48a923d:
      entryPoints:
      - websecure
      middlewares:
      - sf-stripprefixregex_nonpartitioned
      rule: PathPrefix(`/WeatherForecast`)
      service: fabric-Application2-Web1-http-defaultEP-861ef74e-6895-4f76-b4d0-d257f48a923d
      tls:
        options: "false"
  services:
    fabric-Application2-Web1-http-defaultEP:
      loadBalancer:
        healthCheck:
          followRedirects: null
          interval: 10s
          path: /healthcheck
          scheme: http
        passHostHeader: true
        servers:
        - Port: ""
          Scheme: ""
          url: http://machinename:8311
    fabric-Application2-Web1-http-defaultEP-861ef74e-6895-4f76-b4d0-d257f48a923d:
      loadBalancer:
        healthCheck:
          followRedirects: null
          interval: 10s
          path: /healthcheck
          scheme: http
        passHostHeader: true
        servers:
        - Port: ""
          Scheme: ""
          url: http://machinename:8311

ServiceManifest labels defined :

<ServiceTypes>
    <!-- This is the name of your ServiceType. 
         This name must match the string used in RegisterServiceType call in Program.cs. -->
    <StatelessServiceType ServiceTypeName="Web1Type" >
      <Extensions>
        <Extension Name="traefik">
          <Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
            <Label Key="traefik.http.defaultEP">true</Label>
            <Label Key="traefik.http.defaultEP.router.entryPoints">websecure</Label>
            <Label Key="traefik.http.defaultEP.router.rule">PathPrefix(`/WeatherForecast`)</Label>
            <Label Key="traefik.http.defaultEP.router.tls.options">false</Label>
            <Label Key="traefik.http.defaultEP.service.loadbalancer.passhostheader">true</Label>
            <Label Key="traefik.http.defaultEP.service.loadbalancer.healthcheck.path">/healthcheck</Label>
            <Label Key="traefik.http.defaultEP.service.loadbalancer.healthcheck.interval">10s</Label>
            <Label Key="traefik.http.defaultEP.service.loadbalancer.healthcheck.scheme">http</Label>
          </Labels>
        </Extension>
      </Extensions>
    </StatelessServiceType>
  </ServiceTypes>

Is this by design?

@dario-ms
Copy link
Member

dario-ms commented Dec 7, 2021

The fetcher always generates the rules that have the partition information and a default one if there is only one partition. We should set a flag to control that behavior since it doesn't make sense to have both if the service is non-partitioned.

@Mahons
Copy link
Contributor

Mahons commented Sep 24, 2022

I raised this same issue on the previous incarnation of the service traefik v2 plugin. I'm keen to see this implemented on this new version, as my stateless services are all unnecessarily shown twice in the dashboard.

Mahons added a commit to Mahons/service-fabric-traefik that referenced this issue Sep 24, 2022
@Mahons
Copy link
Contributor

Mahons commented Sep 24, 2022

I've pushed a PR for this issue 😁

@egaribay77
Copy link
Collaborator

Fixed by this PR #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants