Workers fail to join if running playbook with some networking situations


To be clear I think this should just be added to the documentation.

I am running the playbook from my laptop at my office. My cluster is at home and is reachable via port-forwarding from my router. My inventory reflects this with ansible_port=<MY_PORTS>. Everything is fine until the workers attempt to join via kubeadm and the task uses {{ groups[‘master’][0] }} to get master ip.

Where I think this approach succeeds:

  • running this playbook from the master, jump-box style
  • running from within my local net, with inventory reflecting this (which would also need to be done for the above)
  • running externally with publicly reachable RPIs not on the same local network

Where it fails:

  • my situation, people using port forwarding on router and getting burned by 1 - not having that port reachable from the router & 2 - getting caught in a NAT loopback snafu

Clearly state the intentions/situations where this playbook should be run (ex: we intend for you to run this from local network) and/or provide workarounds in the documentation or in the task.

For my case, I just pasted the local ip of my master and it worked fine. I would be happy to write some documentation for this if you would like.