<p>I have a situation where I would like to run two kubernetes clusters in the same AWS VPC sharing subnets. This seems to work okay except the weave CNI plugin seems to discover nodes in the other cluster. These nodes get rejected with  "IP allocation was seeded by different peers" which makes sense. They are different clusters. Is there a way to keep weave from finding machines in alternate clusters. When I do <code>weave --local status ipam</code> and <code>weave --local status targets</code> I see the expected targets and ipams for each cluster.</p>

<p>Weave pods are in an infinite loop of connecting and rejecting nodes from alternate clusters. This is chewing up cpu and impacting the clusters. If I run <code>kube-utils</code> inside a weave pod it returns the correct nodes for each cluster. It seems kubernetes should know what peers are available, can I just have weave use the peers that the cluster knows about.</p>

<p>After further investigation I believe the issue is that I have scaled machines up and down for both clusters. IP addresses were re-used from one cluster to the next in the process. For instance Cluster A scaled down a node. Weave continues to attempt connections to the now lost node. Cluster B scales up and uses the ip that was used originally in Cluster A. Weave finds the node. This then made weave "discover" the other cluster nodes. Once it discovers one node from the other cluster, it discovers all the nodes. </p>

<p>I have upgraded from 2.4.0 to 2.4.1 to see if some fixes related to re-using ips mitigates this issue. </p>

<p>There is a demo <a href="https://github.com/weaveworks-experiments/demo-weave-kube-hybrid" rel="nofollow noreferrer">here</a> where Weave Net is run across multiple clusters. This demo was shown in the keynote for KubeCon 2016.</p>

<p>The most important part is <a href="https://github.com/weaveworks-experiments/demo-weave-kube-hybrid/blob/master/weave-kube-join.yaml#L34" rel="nofollow noreferrer">here</a>
which stops subsequent clusters from forming their own cluster and hence rejecting connections from others.</p>

<pre><code>--ipalloc-init=observer
</code></pre>

<p>It's not a particularly clean solution, hacking around with the config, but it does work.</p>
