我应该将哪个匹配器用于托管在localhost {port}上的本地Service Fabric集群的服务

问题描述 投票:0回答:1

我有一个关于Service Fabric和Traefik的问题。

我成功地将Traefik应用程序部署到本地集群(实际上也在我自己的Azure Infra中)。这是另一个应用程序中的服务(MyService),我试图让Traefik(RP)坐在前面。

我可以看到Traefik仪表板,我可以看到后端(似乎表明它已经成功地为我的应用程序和服务调用了SF管理API)。

我还可以看到一个附带的前端,有一些路由规则(匹配器)。但是,对于我的生活,我无法通过RP向我的服务提出简单的请求。

我可以直接打我的服务。 Service Fabric(SF)表示它也处于良好状态。

我的本地SF群集不安全,因此使用.toml设置等有所简化。

我的服务托管在localhost:9025上(端点在服务清单和端口设置(API中的Kestrel)中公开)也是如此。

Traefik设置在5000端口(而不是80端口 - 见下文)。

要明确地进行简单的版本检查,我会使用http://localhost:9025/myservice/myaction/v1/version

http://localhost:5000/myservice/myaction/v1/version让我得到404或503(取决于我用matcher / modifier做什么)。

我已经将Traefik端点从端口80修改为5000,只是为了将其切换并避免任何端口冲突。 (我现在没有IIS站点。)Netstat确认没有其他端口被使用。

Service Manifest中的匹配器如下所示:

             <Extensions>
                <Extension Name="Traefik">
                    <Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
                        <Label Key="traefik.frontend.rule">PathPrefix:/myservice</Label>
                        <Label Key="traefik.enable">true</Label>
                    </Labels>
                </Extension>
```            </Extensions>

One last thing, I guess, that would have really helped would be the ability to see the "resolved" requests.  That is a request that comes into the RP, and then is matched or modified so that I can see what the RP actually reconciles a request out too. Perhaps this already exists, but tweaking of various logging didn't yield this info.
traefik azure-service-fabric
1个回答
1
投票

好的,所以与Traefik有关的服务清单没有任何问题,而是Traefik无法理解的清单中的端点暴露。

这不起作用:

<Endpoint Name="MyService" Protocol="http" Type="Input" Port="9025" />

但是,这将:

<Endpoint Name="MyService" UriScheme="http" Port="9025" />

(我省略的其他属性仍然可以添加,但这似乎是Traefik将其列为可行后端所需的最小值)

Traefik日志中显示了明确的布线指示(之前不存在)

Wiring frontend frontend-fabric:/MyApp/MyService to entryPoint http

并且,在UI中,对于后端,再次显示服务器URI,这不是之前的。

请原谅我,如果这是在某处记录,但我找不到任何其他我认为没有看到服务器URI是一个问题基于在Service Fabric和Traefik设置网站上的屏幕截图。

另一个症状是,如果未正确连接后端,则后端将显示为红色,正确配置后,它将为绿色。

正如我所说,可能非常明显但我在这个简单的修正案中失去了很多时间。

© www.soinside.com 2019 - 2024. All rights reserved.