<p>I have in my home lab a default installation of Kubernetes with kube-router as the network provider. kube-router is, as default, set as the service proxy. I have not set an explicit service-cluster-ip-network in my kube-controller-manager, so kube-router should be assigning service cluster IPs only within the default 10.96.x.x/16 subnet. However, I am regularly getting service cluster IPs anywhere within the larger 10.x.x.x./8 subnet. I am at a loss where/why it's not remaining within 10.96.x.x. Ideas? Thanks!</p>

Scott Balmos
<p><strong>TL;DR</strong></p>
<p>Your Kubernetes cluster is behaving correctly.</p>
<p><strong>By default (if not specified otherwise) using <code>kubeadm</code> to provision your cluster, the <code>--service-cidr</code> is set to <code>10.96.0.0/12</code></strong>.</p>
<p><code>ClusterIP</code> address like <code>10.110.15.13</code> would be included in the above mentioned network (<code>10.96.0.0/12</code>).</p>
<p>I've provided more explanation below:</p>
<hr />
<h3>Subnetting</h3>
<p>If you use one of the available online <a href="http://jodies.de/ipcalc?host=10.96.0.0&amp;mask1=12&amp;mask2=" rel="nofollow noreferrer">IP calculators</a> you will be seeing exact same situation like the one included below:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>CIDR</th>
<th>10.96.0.0/12</th>
</tr>
</thead>
<tbody>
<tr>
<td>Subnet mask</td>
<td>255.240.0.0</td>
</tr>
<tr>
<td>Network address (first)</td>
<td>10.96.0.0</td>
</tr>
<tr>
<td>Broadcast address (last)</td>
<td>10.111.255.255</td>
</tr>
<tr>
<td>First useable address</td>
<td><strong>10.96.0.1</strong></td>
</tr>
<tr>
<td>Last useable address</td>
<td><strong>10.111.255.254</strong></td>
</tr>
<tr>
<td>Number of hosts allocatable</td>
<td>1048574</td>
</tr>
</tbody>
</table>
</div>
<p>By above diagram you can see that the <code>Service IP</code> range would be following:</p>
<ul>
<li><code>10.96.0.1</code>-<code>10.111.255.254</code></li>
</ul>
<p>This would make IP's like: <code>10.104.5.2</code>, <code>10.110.15.13</code> <strong>be in range</strong> of above network.</p>
<hr />
<h3>Kubernetes <code>--service-cidr</code></h3>
<p>As said earlier if you don't specify the <code>--service-cidr</code> when using <code>$ kubeadm init</code> it will be set to default <code>10.96.0.0/12</code>.</p>
<p>Following the official documentation of <code>kubeadm</code>:</p>
<blockquote>
<pre class="lang-sh prettyprint-override"><code>--service-cidr string     Default: &quot;10.96.0.0/12&quot;
Use alternative range of IP address for service VIPs.
</code></pre>
<p>-- <em><a href="https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/#options" rel="nofollow noreferrer">Kubernetes.io: Docs: Reference: Setup tools: Kubeadm: Kubeadm init: Options</a></em></p>
</blockquote>
<p>If you provision the cluster without this parameter, you will be able to see it configured in the:</p>
<ul>
<li><code>kube-apiserver</code>:</li>
</ul>
<pre class="lang-sh prettyprint-override"><code>$ kubectl get pods -n kube-system   kube-apiserver-kubernetes-NODE_NAME -o yaml | grep &quot;service-cluster-ip-range&quot; 
    - --service-cluster-ip-range=10.96.0.0/12
</code></pre>
<ul>
<li><code>kube-controller-manager</code></li>
</ul>
<pre class="lang-sh prettyprint-override"><code>$ kubectl get pods -n kube-system   kube-controller-manager-kubernetes-NODE_NAME -o yaml | grep &quot;service-cluster-ip-range&quot; 
    - --service-cluster-ip-range=10.96.0.0/12
</code></pre>
<hr />
<h3>Kube-router</h3>
<p>It's also explicitly stated in the <code>kube-router</code>'s source code:</p>
<blockquote>
<pre class="lang-golang prettyprint-override"><code>func NewKubeRouterConfig() *KubeRouterConfig {
  return &amp;KubeRouterConfig{
      // SKIPPED 
      ClusterIPCIDR:                  &quot;10.96.0.0/12&quot;,
       // SKIPPED
  }
}
</code></pre>
<p>-- <em><a href="https://github.com/cloudnativelabs/kube-router/blob/c14588535433e3c334fa4dd639168619f9a34210/pkg/options/options.go#L73" rel="nofollow noreferrer">Github.com: Cloudnativelabds: Kube-router: Pkg: Options: Options.go: Line 73</a></em></p>
</blockquote>
<blockquote>
<pre class="lang-golang prettyprint-override"><code>  fs.StringVar(&amp;s.ClusterIPCIDR, &quot;service-cluster-ip-range&quot;, s.ClusterIPCIDR,
      &quot;CIDR value from which service cluster IPs are assigned. Default: 10.96.0.0/12&quot;)
</code></pre>
<p>-- <em><a href="https://github.com/cloudnativelabs/kube-router/blob/c14588535433e3c334fa4dd639168619f9a34210/pkg/options/options.go#L187" rel="nofollow noreferrer">Github.com: Cloudnativelabds: Kube-router: Pkg: Options: Options.go: Line 187</a></em></p>
</blockquote>
<p>It's also referenced in the <a href="https://github.com/cloudnativelabs/kube-router/blob/master/docs/user-guide.md" rel="nofollow noreferrer">user guide</a>.</p>
