<p>The title says it all; how does Kubernetes assign an IP to fieldPath: status.hostIP on a host with multiple interfaces and IPs.</p>
<p>If My node has the  following IPs</p>
<pre class="lang-sh prettyprint-override"><code># ip a | grep &quot;inet &quot;
inet 127.0.0.1/8 scope host lo
inet 10.68.48.206/22 brd 10.68.51.255 scope global virbr0
inet 253.255.0.35/24 brd 253.255.0.255 scope global bond0.3900
inet 10.244.2.0/32 scope global flannel.1
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
</code></pre>
<p>Kube picks 10.68.48.206 when I want it to pick  253.255.0.35, so how does it decide?</p>
<p>Is it based off of DNS hostname resolution?</p>
<pre class="lang-sh prettyprint-override"><code>nslookup ca-rain03
Server:     10.68.50.60
Address:    10.68.50.60#53
</code></pre>
<p>Or default route?</p>
<pre class="lang-sh prettyprint-override"><code># route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.68.48.1      0.0.0.0         UG    0      0        0 virbr0
10.0.0.0        10.68.48.1      255.0.0.0       UG    0      0        0 virbr0
10.68.48.0      0.0.0.0         255.255.252.0   U     0      0        0 virbr0
10.244.0.0      10.244.0.0      255.255.255.0   UG    0      0        0 flannel.1
10.244.1.0      10.244.1.0      255.255.255.0   UG    0      0        0 flannel.1
169.254.0.0     0.0.0.0         255.255.0.0     U     1007   0        0 bond0
169.254.0.0     0.0.0.0         255.255.0.0     U     1045   0        0 bond0.3900
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
253.255.0.0     0.0.0.0         255.255.255.0   U     0      0        0 bond0.3900
</code></pre>
<p>Or something else?  How can I pass the host IP of 253.255.0.35 into a pod?</p>
<p>Thanks</p>

<p>It's really picked up by the <a href="https://kubernetes.io/docs/concepts/architecture/nodes/" rel="nofollow noreferrer">kubelet</a> the configuration. For example, on pretty much all *nix systems it's managed by <a href="https://en.wikipedia.org/wiki/Systemd" rel="nofollow noreferrer">systemd</a>. So you can see it like this 👀:</p>
<pre class="lang-sh prettyprint-override"><code>systemctl cat kubelet
# Warning: kubelet.service changed on disk, the version systemd has loaded is outdated.
# This output shows the current version of the unit's original fragment and drop-in files.
# If fragments or drop-ins were added or removed, they are not properly reflected in this output.
# Run 'systemctl daemon-reload' to reload units.
# /lib/systemd/system/kubelet.service
[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=http://kubernetes.io/docs/

[Service]
ExecStart=/var/lib/minikube/binaries/v1.18.3/kubelet
Restart=always
StartLimitInterval=0
# Tuned for local dev: faster than upstream default (10s), but slower than systemd default (100ms)
RestartSec=600ms

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
[Unit]
Wants=docker.socket

[Service]
ExecStart=
ExecStart=/var/lib/minikube/binaries/v1.18.3/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --config=/var/lib/kubelet/c
onfig.yaml --container-runtime=docker --hostname-override=minikube --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=172.17.0.2 👈

[Install]
</code></pre>
<p>You can see the node IP is identified with the <code>--node-ip=172.17.0.2</code> kubelet option. 💡</p>
<p>✌️☮️</p>
