Preheat the oven to 450F. Make the marinade by adding the olive oil, brown sugar, garlic powder, cumin, paprika, red pepper flakes, lime zest and lime juice to a bowl and stir until combine.
Pat the chicken dry with paper towels. Use a pastry brush to brush the marinade evenly across the chicken, including in all the nooks and crannies.
Cut the onion into large pieces and cut the garlic in half. Add the onions to a large cast iron pan (or any oven safe pan) and toss with 1 tbsp of olive oil. Add the garlic, cut side down, to the pan. Add the whole chicken on top, making sure the wings and legs are tucked in.
Transfer the chicken to the oven and cook for 45-60 minutes, until the internal temp of the deepest part of the chicken leg reaches 165F. Check on the chicken after 15-20 minutes. If the chicken is browning more than you like, loosely cover it with tin foil for the remaining cook time.
While the chicken is cooking, prepare the salsa. Cut the pineapple into small cubes and add it to a bowl. Add chopped cilantro, red onion, lime juice, garlic powder, and salt. Stir and set aside.
When the chicken is done, let it rest for 5-10 minutes before cutting into it. Serve with rice or tortillas, and the pineapple salsa. Enjoy!