Heat oven to 325°F (165°C).
Grease and flour a 10-cup bundt pan or line a 9x5-inch loaf pan with parchment.
Drain pineapple well. Press with paper towels to remove extra moisture.
Bring ingredients to room temperature. This ensures a smooth, even batter.
Cream the butter and sugar: Beat butter and sugar on medium speed for 3–4 minutes until pale and fluffy.
Add eggs one at a time: Mix well after each addition. Scrape the bowl as needed.
Whisk dry ingredients: In a separate bowl, combine flour, baking powder, and salt.
Combine wet ingredients: Stir coconut milk, sour cream, vanilla, and coconut extract together.
Add dry and wet in turns: Mix in one-third of the flour, then half the coconut milk mixture, and repeat, ending with flour. Mix just until incorporated.
Fold in pineapple and coconut: Gently fold with a spatula to avoid overmixing. Add rum if using.
Fill the pan: Smooth the top and tap the pan to release air bubbles.
Bake 55–70 minutes for a bundt; 60–75 minutes for a loaf. Check for doneness with a skewer—moist crumbs are fine, but no wet batter.
Tent with foil if the top browns too quickly around the 45-minute mark.
Cool 15 minutes in the pan, then invert onto a rack to cool completely.
Whisk the glaze ingredients until smooth and pourable. Adjust with more coconut milk to thin or powdered sugar to thicken.
Drizzle over the cooled cake. Sprinkle with toasted coconut if you like.
Let the glaze set 20–30 minutes before slicing.