How to use Internet Recovery to reinstall macOS
Here's what to do if you haven't got a recovery partition on your Mac and need to reinstall macOS (in fact, even if you don't need to reinstall macOS you probably should, because a missing Recovery Partition is not a good sign).
This will put a recovery partition on the external disk. You can continue installing macOS on the startup drive after creating a recovery system on an external drive.
You cannot use macOS’ FileVault disk encryption unless the recovery partition is present on the startup drive. Also, using RAID partitions or non-standard Boot Camp partitions on the startup drive might prevent macOS from installing a local recovery partition.