Attempt internal connection using pod IP and exposed port.
This commit is contained in:
parent
b92c1b970d
commit
61d2185bb6
|
@ -82,7 +82,7 @@ namespace KubernetesWorkflow
|
||||||
|
|
||||||
return new RunningContainer(runningPod, r, servicePorts, startupConfig,
|
return new RunningContainer(runningPod, r, servicePorts, startupConfig,
|
||||||
GetContainerExternalAddress(runningPod, servicePorts),
|
GetContainerExternalAddress(runningPod, servicePorts),
|
||||||
GetContainerInternalAddress(servicePorts));
|
GetContainerInternalAddress(runningPod, r, servicePorts));
|
||||||
|
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
}
|
}
|
||||||
|
@ -94,14 +94,17 @@ namespace KubernetesWorkflow
|
||||||
GetServicePort(servicePorts));
|
GetServicePort(servicePorts));
|
||||||
}
|
}
|
||||||
|
|
||||||
private RunningContainerAddress GetContainerInternalAddress(Port[] servicePorts)
|
private RunningContainerAddress GetContainerInternalAddress(RunningPod pod, ContainerRecipe recipe, Port[] servicePorts)
|
||||||
{
|
{
|
||||||
var serviceName = "service-" + numberSource.WorkflowNumber;
|
var ip = pod.Ip;
|
||||||
var namespaceName = cluster.Configuration.K8sNamespacePrefix + testNamespace;
|
var port = recipe.ExposedPorts.First().Number;
|
||||||
|
//var serviceName = "service-" + numberSource.WorkflowNumber;
|
||||||
|
//var namespaceName = cluster.Configuration.K8sNamespacePrefix + testNamespace;
|
||||||
|
|
||||||
return new RunningContainerAddress(
|
return new RunningContainerAddress(
|
||||||
$"http://{serviceName}.{namespaceName}.svc.cluster.local",
|
//$"http://{serviceName}.{namespaceName}.svc.cluster.local",
|
||||||
GetServicePort(servicePorts));
|
$"http://{ip}",
|
||||||
|
port);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int GetServicePort(Port[] servicePorts)
|
private static int GetServicePort(Port[] servicePorts)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using DistTestCore;
|
using DistTestCore;
|
||||||
using DistTestCore.Codex;
|
|
||||||
using DistTestCore.Helpers;
|
using DistTestCore.Helpers;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|
Loading…
Reference in New Issue