<p>I have a GoogleCloud Kubernetes cluster consisting of multiple nodes and a GoogleCloud Redis Memorystore. Distributed over these nodes are replicas of a pod containing a container that needs to connect to the Redis Memorystore. I have noticed that one of the nodes is not able to connect to Redis, i.e. any container in a pod on that node cannot connect to Redis.</p>

<p>The Redis Memorystore has the following properties:</p>

<ul>
<li>IP address: <code>10.0.6.12</code></li>
<li>Instance IP address range: <code>10.0.6.8/29</code> (<code>10.0.6.8</code> - <code>10.0.6.15</code>)</li>
</ul>

<p>The node from which no connection to Redis can be made has the following properties:</p>

<ul>
<li>Internal IP: <code>10.132.0.5</code></li>
<li>PodCIDR: <code>10.0.6.0/24</code> (<code>10.0.6.0</code> - <code>10.0.6.255</code>)</li>
</ul>

<p>I assume this problem is caused by the overlap in IP ranges of the Memorystore and this node. Is this assumption correct?</p>

<p>If this is the problem I would like to change the IP range of the node.
I have tried to do this by editing <code>spec.podCIRD</code> in the node config:</p>

<pre><code>$ kubectl edit node &lt;node-name&gt;
</code></pre>

<p>However this did not work and resulted in the error message:</p>

<pre><code># * spec.podCIDR: Forbidden: node updates may not change podCIDR except from "" to valid
# * []: Forbidden: node updates may only change labels, taints, or capacity (or configSource, if the DynamicKubeletConfig feature gate is enabled)
</code></pre>

<p>Is there another way to change the IP range of an existing Kubernetes node? If so, how?</p>

<p>Sometimes I need to temporarily increase the number of pods in a cluster. When I do this I want to prevent Kubernetes from creating a new node with the IP range <code>10.0.6.0/24</code>.
Is it possible to tell the Kubernetes cluster to not create new nodes with the IP range <code>10.0.6.0/24</code>? If so, how?</p>

<p>Thanks in advance!</p>

<ul>
<li><p>Not for a node. The podCidr gets defined when you install your network overlay in initial steps when setting up a new cluster.</p></li>
<li><p>Yes for the cluster. but it's not that easy. You have to change the podCidr for the network overlay in your whole cluster. It's a tricky process that can be done, but if you are doing that you might as well deploy a new cluster. Keep in mind that some network overlays require a very specific PodCidr. For example, Calico requires <code>192.168.0.0/16</code></p></li>
</ul>

<p>You could:</p>

<ol>
<li>Create a new cluster with a new cidr and move your workloads gradually.</li>
<li>Change the IP address cidr where your GoogleCloud Redis Memorystore lives.</li>
</ol>

<p>Hope it helps!</p>
