Hi everyone, I have been using the results of this thread with great success for some time but we are seeing a very odd behavior recently:
Issue description:
2 IPFS nodes
Node A: 1 inside of kubernetes
Node B: 1 standalone node outside of kubernetes
Behavior:
When Node B connects to Node A, the address resolution for Node B does NOT MATCH the expected IP address. This results in file retrieval operations from A <-> B failing
-
Node B executes the following, successfully connecting to Node A:
ubuntu@ip-172-31-25-18:~$ ipfs swarm connect /ip4/54.202.115.116/tcp/30882/ipfs/QmcrMUeg6nNYp2CGMmC2Q1wqcx2ohZzMkebQNx1dQaxWT2 connect QmcrMUeg6nNYp2CGMmC2Q1wqcx2ohZzMkebQNx1dQaxWT2 success
-
Node A has a reference to Node B, but the IP address IS INCORRECT, referencing the internal k8s IP address…
/# ipfs swarm peers | grep QmRe12uTMbx9WRiVVuZpacYjFhB5Pm6naM6XSHJmxmPXm1 /ip4/192.168.15.104/tcp/10570/ipfs/QmRe12uTMbx9WRiVVuZpacYjFhB5Pm6naM6XSHJmxmPXm1
How can we resolve this issue?
Node A has been configured to announce a specific IP address and port retrieved from the cluster’s service definition - with the end result being something as follows:
/ # ipfs id
{
"ID": "QmcrMUeg6nNYp2CGMmC2Q1wqcx2ohZzMkebQNx1dQaxWT2",
"PublicKey": "",
"Addresses": [
"/ip4/54.202.115.116/tcp/30882/ipfs/QmcrMUeg6nNYp2CGMmC2Q1wqcx2ohZzMkebQNx1dQaxWT2"
],
"AgentVersion": "go-ipfs/0.4.22/",
"ProtocolVersion": "ipfs/0.1.0"
}
In the above case, our config has been modified with the following:
"Announce ": [
"/ip4/54.202.115.116/tcp/30882"
],
The external IP is deduced from the node IP and the service port
Node B has the following connection information:
ubuntu@ip-172-31-25-18:~$ ipfs id
{
"ID": "QmRe12uTMbx9WRiVVuZpacYjFhB5Pm6naM6XSHJmxmPXm1",
"PublicKey": "",
"Addresses": [
"/ip4/127.0.0.1/tcp/4001/ipfs/QmRe12uTMbx9WRiVVuZpacYjFhB5Pm6naM6XSHJmxmPXm1",
"/ip6/::1/tcp/4001/ipfs/QmRe12uTMbx9WRiVVuZpacYjFhB5Pm6naM6XSHJmxmPXm1",
"/ip4/34.213.124.44/tcp/4001/ipfs/QmRe12uTMbx9WRiVVuZpacYjFhB5Pm6naM6XSHJmxmPXm1"
],
"AgentVersion": "go-ipfs/0.4.22/",
"ProtocolVersion": "ipfs/0.1.0"
}