Kubernetes 从NodeJs到Application Insight的连接问题

Kubernetes 从NodeJs到Application Insight的连接问题,kubernetes,azure-application-insights,istio,Kubernetes,Azure Application Insights,Istio,我有一个kubernetes星系团和Istio 在Pod y内部有一个nodejs项目,配置了App Insight appInsights .setup(process.env.APP_INSIGHT_INSTRUMENTATION_KEY) .setAutoDependencyCorrelation(true) .setAutoCollectRequests(true) .setAutoCollectPerformance(true, true) .setAutoCollectExcepti

我有一个kubernetes星系团和Istio

在Pod y内部有一个nodejs项目,配置了App Insight

appInsights
.setup(process.env.APP_INSIGHT_INSTRUMENTATION_KEY)
.setAutoDependencyCorrelation(true)
.setAutoCollectRequests(true)
.setAutoCollectPerformance(true, true)
.setAutoCollectExceptions(true)
.setAutoCollectDependencies(true)
.setAutoCollectConsole(true)
.setUseDiskRetryCaching(true)
.setSendLiveMetrics(true)
.setDistributedTracingMode(appInsights.DistributedTracingModes.AI)
.start();
当y测试在本地工作很好时,问题是当我将项目上传到k8s时,我有连接拒绝

ApplicationInsights:CorrelationIdManager[ 错误:连接ECONREFUSSED 40.71.13.169:443 在TCPConnectWrap.afterConnect[as oncomplete](net.js:1145:16) 在TCPConnectWrap.callbackTrampoline(internal/async_hooks.js:126:14){ 错误号:'econnrefered', 代码:'econnreference', 系统调用:“连接”, 地址:“40.71.13.169”, 港口:443 } ]


可能会发生这种情况?

您需要允许从防火墙进行出站连接。不确定您是否在Azure中托管Kubernetes群集。如果是,它将是连接到集群VNET的网络安全组,您可以在其中允许“AzureMonitor”出站连接,以避免对IP地址的硬依赖

此外,由于您使用的是Istio,请确保(尽管默认情况下应在代理中启用)