Each city-states had their own rulers. Some of the princely ones where: Florence, Venice, Milan, Rome, Naples, and all of these had rulers like Medici, Doge, Pope, etc.
You can also understand this by the definition of city-states itself. A city-state is an area which is rules on is own by major cities. They had a mix of both hereditary rulers as well as elected rulers. :D