Dissolve the sugar in a bowl of boiling water and set aside to cool.
Wash the pineapple thoroughly.
Cut off the crown of the pineapple. You can cut and save individual leaves to use as a garnish when serving.
Cut off the skin of the pineapple - we will be using the peels for this recipe, so don't throw them away! Save (and eat!) the flesh.
Slice the chili into ~1cm pieces.
Add the sugar syrup, pineapple skin, chili, cinnamon, star anise, and cloves to your jug. Top up with drinking water until almost full. Note: as the tepache begins to ferment, a foam will start to form on top of the liquid, so make sure your jug isn't too full!
Make sure all the ingredients are completely submerged, to prevent any mold forming.
Cover the jug with a tea towel and secure in place with a rubber band or twine.
Leave the drink to ferment for 24-72 hours. The speed of the fermentation will vary depending on the temperature and humidity of the environment, so make sure to keep an eye on it and taste at 12-24h intervals.
A light layer of foam and bubbles is normal as it ferments, but if it looks fuzzy, hairy, or has coloured spots, discard without tasting and start again!
Once you're happy with the taste, strain and serve over ice. Don't forget to garnish with the leaves you saved earlier!