`xargs -L1` is equivalent and compatible with all platforms to `xargs -l` which is only gnu xargs specific. `xargs -l` is equivalent to `xargs -L1`
The kubeControllerManager endpoints were being cleared on each iteration of the loop over control nodes leading to only the last control node being added. Instead the array has been cleared outside of the loop.