sanded the back of a Garmin bike mount until flat (the type that holds with 2 elastics), glued to the flat bar at the back of my rack with some double sided tape (type used for gopro cameras).
... this assuming that your rack has a flat part at the back for mounting lights/reflectors (like most)