<p>I am running a Kubernetes cluster on GKE and I noticed that in kube-system the IP addresses of pods with</p>

<pre><code>fluentd-gcp-...
kube-proxy-gke-gke-dev-cluster-default-pool-...
prometheus-to-...
</code></pre>

<p>are the same as those of the nodes, while other pods such as</p>

<pre><code>event-exporter-v0.3.0-...
stackdriver-metadata-agent-cluster-level-...
fluentd-gcp-scaler-...
heapster-gke-...
kube-dns-...
l7-default-backend-...
metrics-server-v0.3.3-...
</code></pre>

<p>e.g.</p>

<pre><code>kube-system   fluentd-gcp-scaler-bfd6cf8dd-58m8j                          1/1     Running   0          23h   10.36.1.6   dev-cluster-default-pool-c8a74531-96j4   &lt;none&gt;           &lt;none&gt;
kube-system   fluentd-gcp-v3.1.1-24n5s                                    2/2     Running   0          24h   10.10.1.5   dev-cluster-default-pool-c8a74531-96j4   &lt;none&gt;           &lt;none&gt;
</code></pre>

<p>where the pod IP range is: 10.36.0.0/14</p>

<p>and nodes are on 10.10.1.0/24</p>

<p>have IP addresses in pod address range. What is specific about the first three?</p>

Mike
<p>This is because pods such as kube proxy , Fluentd, Prometheus are running in host network directly via <code>hostNetwork: true</code>. You can describe those pods and verify that <code>hostNetwork: true</code> is present. </p>

<p>Now coming to the point why these pods need to run in host network in the first place , kube proxy needs access to host's IP tables, prometheus collects metrics and Fluentd collects logs from the host system.</p>

<p>You can just deploy a sample pod such as nginx with <code>hostNetwork: true</code> and it will get node IP.If you remove <code>hostNetwork: true</code> it will get IP from pod CIDR range.</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  labels:
    run: nginx
  name: nginx
spec:
  containers:
  - image: nginx
    name: nginx
  restartPolicy: Always
  hostNetwork: true
</code></pre>
