Remaps running container internal address to service endpoint
This commit is contained in:
parent
9747846787
commit
4d654e106c
|
@ -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(runningPod, r, servicePorts));
|
GetContainerInternalAddress(r));
|
||||||
|
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
}
|
}
|
||||||
|
@ -94,16 +94,14 @@ namespace KubernetesWorkflow
|
||||||
GetServicePort(servicePorts));
|
GetServicePort(servicePorts));
|
||||||
}
|
}
|
||||||
|
|
||||||
private RunningContainerAddress GetContainerInternalAddress(RunningPod pod, ContainerRecipe recipe, Port[] servicePorts)
|
private RunningContainerAddress GetContainerInternalAddress(ContainerRecipe recipe)
|
||||||
{
|
{
|
||||||
var ip = pod.Ip;
|
var serviceName = "service-" + numberSource.WorkflowNumber;
|
||||||
|
var namespaceName = cluster.Configuration.K8sNamespacePrefix + testNamespace;
|
||||||
var port = recipe.ExposedPorts.First().Number;
|
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",
|
||||||
$"http://{ip}",
|
|
||||||
port);
|
port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue