trying with podIP for internal addresses.
This commit is contained in:
parent
b3ba39b2e5
commit
eb70fe612b
|
@ -145,7 +145,7 @@ namespace KubernetesWorkflow
|
|||
result.Add(new ContainerPort(
|
||||
exposedPort,
|
||||
GetContainerExternalAddress(pod, servicePorts, exposedPort),
|
||||
GetContainerInternalAddress(exposedPort)));
|
||||
GetContainerInternalAddress(pod, exposedPort)));
|
||||
}
|
||||
foreach (var internalPort in recipe.InternalPorts)
|
||||
{
|
||||
|
@ -154,7 +154,7 @@ namespace KubernetesWorkflow
|
|||
result.Add(new ContainerPort(
|
||||
internalPort,
|
||||
new Address(string.Empty, 0),
|
||||
GetContainerInternalAddress(internalPort)));
|
||||
GetContainerInternalAddress(pod, internalPort)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,12 +170,15 @@ namespace KubernetesWorkflow
|
|||
servicePort.Number);
|
||||
}
|
||||
|
||||
private Address GetContainerInternalAddress(Port port)
|
||||
private Address GetContainerInternalAddress(RunningPod pod, Port port)
|
||||
{
|
||||
var serviceName = "service-" + numberSource.WorkflowNumber;
|
||||
//var serviceName = "service-" + numberSource.WorkflowNumber;
|
||||
//return new Address(
|
||||
// $"http://{serviceName}.{k8sNamespace}.svc.cluster.local",
|
||||
// port.Number);
|
||||
|
||||
return new Address(
|
||||
$"http://{serviceName}.{k8sNamespace}.svc.cluster.local",
|
||||
$"http://{pod.PodInfo.Ip}",
|
||||
port.Number);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,12 +17,9 @@ namespace CodexContractsPlugin
|
|||
{
|
||||
var config = startupConfig.Get<CodexContractsContainerConfig>();
|
||||
|
||||
var containerPort = config.GethNode.StartResult.Container.GetContainerPort(GethContainerRecipe.HttpPortTag);
|
||||
var address = config.GethNode.StartResult.Container.GetAddress(GethContainerRecipe.HttpPortTag);
|
||||
|
||||
var ip = config.GethNode.StartResult.Container.Pod.PodInfo.Ip;
|
||||
var port = containerPort.InternalAddress.Port;
|
||||
|
||||
AddEnvVar("DISTTEST_NETWORK_URL", $"http://{ip}:{port}");
|
||||
AddEnvVar("DISTTEST_NETWORK_URL", address.ToString());
|
||||
AddEnvVar("HARDHAT_NETWORK", "codexdisttestnetwork");
|
||||
AddEnvVar("KEEP_ALIVE", "1");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue