Step-by-step explanation:
The formation of an ionic bond involves the octet rule because every atoms wants to have a stable configuration.
In ionic bond, a metal will lose its electrons to become isoelectronic with the nearest noble gas. Therefore, the octet rule is obeyed
The non-metal gains the electrons and becomes a stable octet
The electrostatic attraction between the opposite charges results in the bond