Is is possible to choose internal IP for kubernetes host network pod

9/18/2018

My kubernetes node has two internal IPs

status:
  addresses:
  - address: 10.10.96.70
    type: ExternalIP
  - address: 10.10.97.77
    type: InternalIP
  - address: 10.10.96.70
    type: InternalIP

When I deploy a hostnetwork pod, the first internal IP (10.10.97.77) is always used. Is it possible to use the second internal IP instead?

-- Kintarō
kubernetes

1 Answer

9/18/2018

You can override on your kubelet with the --node-ip string option.

--node-ip string
IP address of the node. If set, kubelet will use this IP address for the node

More information here

-- Rico
Source: StackOverflow