我已经在Azure Service Fabric集群上部署了Traefik,并使用以下配置:
# Enable Service Fabric configuration backend
[servicefabric]
# Service Fabric Management Endpoint
clustermanagementurl = "https://localhost:19080"
# Service Fabric Management Endpoint API Version
apiversion = "3.0"
insecureSkipVerify = true
然而,打开Traefik仪表板时,我得到了一个空白屏幕,因为它无法映射所有我的Fabric应用程序。
在我的一台VM上查看Traefik日志时,我反复看到这个错误: level=error msg="failed to connect to Service Fabric server Get https://localhost:19080/Applications/?api-version=3.0: x509: certificate is valid for .eastus.cloudapp.azure.com, not localhost on https://localhost:19080/Applications/?api-version=3.0"
我的Azure Service Fabric集群有一个由受信任的CA签名的SSL证书:
![Service Fabric management portal](https://istack.dev59.com/7ZWTz.webp)
编辑1:
如果有帮助的话,这是Traefik加载的配置(根据日志记录):
{
"LifeCycle": {
"RequestAcceptGraceTimeout": 0,
"GraceTimeOut": 0
},
"GraceTimeOut": 0,
"Debug": true,
"CheckNewVersion": true,
"AccessLogsFile": "",
"AccessLog": null,
"TraefikLogsFile": "",
"TraefikLog": null,
"LogLevel": "DEBUG",
"EntryPoints": {
"http": {
"Network": "",
"Address": ":80",
"TLS": null,
"Redirect": null,
"Auth": null,
"WhitelistSourceRange": null,
"Compress": false,
"ProxyProtocol": null,
"ForwardedHeaders": {
"Insecure": true,
"TrustedIPs": null
}
}
},
"Cluster": null,
"Constraints": [],
"ACME": null,
"DefaultEntryPoints": [
"http"
],
"ProvidersThrottleDuration": 2000000000,
"MaxIdleConnsPerHost": 200,
"IdleTimeout": 0,
"InsecureSkipVerify": true,
"RootCAs": null,
"Retry": null,
"HealthCheck": {
"Interval": 30000000000
},
"RespondingTimeouts": null,
"ForwardingTimeouts": null,
"Docker": null,
"File": null,
"Web": {
"Address": ":9000",
"CertFile": "",
"KeyFile": "",
"ReadOnly": false,
"Statistics": null,
"Metrics": null,
"Path": "/",
"Auth": null,
"Debug": false,
"CurrentConfigurations": null,
"Stats": null,
"StatsRecorder": null
},
"Marathon": null,
"Consul": null,
"ConsulCatalog": null,
"Etcd": null,
"Zookeeper": null,
"Boltdb": null,
"Kubernetes": null,
"Mesos": null,
"Eureka": null,
"ECS": null,
"Rancher": null,
"DynamoDB": null,
"ServiceFabric": {
"Watch": false,
"Filename": "",
"Constraints": null,
"Trace": false,
"DebugLogGeneratedTemplate": false,
"ClusterManagementURL": "https://localhost:19080",
"APIVersion": "3.0",
"UseCertificateAuth": false,
"ClientCertFilePath": "",
"ClientCertKeyFilePath": "",
"InsecureSkipVerify": true
}
}
编辑 2:
有人建议使用我集群的远程地址而不是localhost
,这样做会导致不同的错误:
提供程序连接错误:无法连接到Service Fabric服务器。 获取https://<hidden>.eastus.cloudapp.azure.com:19080/Applications/?api-version=3.0时出错:流错误:流ID 1;在https://<hidden>.eastus.cloudapp.azure.com:19080/Applications/?api-version=3.0上需要HTTP_1_1_REQUIRED;656.765021毫秒后重试
UseCertificateAuth: true
并指定证书所在位置。 - Diego Mendes