-
Notifications
You must be signed in to change notification settings - Fork 16
Implement Private Networking #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6ca3f70
to
5dd459f
Compare
api/v1alpha1/ipfscluster_types.go
Outdated
} | ||
|
||
// IpfsClusterSpec defines the desired state of the IpfsCluster. | ||
type IpfsClusterSpec struct { | ||
// url defines the URL to be using as an ingress controller. | ||
// +kubebuilder:validation:Optional | ||
URL string `json:"url"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL is deleted from spec because I did not see it used anywhere in the operator and I don't want to confuse users. Feel free to let me know if this needs to stay
api/v1alpha1/ipfscluster_types.go
Outdated
// networkMode is a switch which defines whether this IPFSCluster will use | ||
// the global IPFS network or create its own. | ||
// +kubebuilder:validation:Enum={public,private} | ||
NetworkMode NetworkMode `json:"networkMode,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could just be the Public
boolean flag from the spec instead of an enum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
12f03fd
to
1c5b15d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a very quick look
for _, circuitAddr := range peer.Addrs { | ||
bootstrapAddr := fmt.Sprintf("%s/p2p/%s/p2p-circuit/p2p/%s", circuitAddr.String(), circuitID.String(), initPeerID) | ||
bootstrapPeers = append(bootstrapPeers, bootstrapAddr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems off... peers in a private network would not need to use relays to contact each other as they can dial each other directly over their LAN IPs...
There's also a question of what are relays for in private networks. The relays cannot communicate to ipfs nodes at all if those nodes are configured with a PNET key. The relays would need support for private networks too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added PSK support within the relay daemon within the release of go-libp2p-relay-daemon
v0.4.0.
cc44e95
to
859dab5
Compare
Signed-off-by: Oleg <[email protected]>
Signed-off-by: Oleg <[email protected]>
Signed-off-by: Oleg <[email protected]>
Signed-off-by: Oleg <[email protected]>
Signed-off-by: Oleg <[email protected]>
Signed-off-by: Oleg <[email protected]>
Signed-off-by: Oleg <[email protected]>
Signed-off-by: Oleg <[email protected]>
Signed-off-by: Oleg <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
9d5891f
to
772ad22
Compare
Signed-off-by: Oleg S <[email protected]>
No major concerns from my end. A question and a single nit but great job cleaning up some hardcoded values that may have caused us pain down the line |
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
/LGTM |
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Signed-off-by: Oleg S <[email protected]>
Fixes MAN-11
This PR implements private networking through the following mechanisms:
.spec.networking.networkMode
which can be in one of two modes:public
orprivate
.private
is set, the IPFS operator generates a swarm key and sets it as theIPFS_SWARM_KEY
environment variable for each of the IPFS containers, includingconfigure-ipfs
.