They connect to a 4 pin trailer plug that comes out of the rack in the stake pocket. So if I want to take the rack off I can just unplug it.
For switching I used the factory ones. 2 and 3. 3 is strobes and 2 is the backup lights. Have been thinking about added a relay so that the lights come on in reverse with a switch override. So when I plow I don't have to keep flipping the switch and they don't come on all the time.
Also added a momentary switch behind the steering wheel that changes flash patterns on the strobes.