For what we call caste today, varna, colour, is used in ancient scriptures.

The four varnas are:
Brahmana – Clergy, Intellectuals – the cleric power. The head thinks.
Kshatriya – Regents, Warriors – the mundane power. The arms protect.
Vaishya – Farmers, Merchants. The thighs bear.
Shudra – Workers. The feed support.

In the myths the king and his adviser, a sage, appear. Together they govern the empire.

In heaven the same duo rules – Brihaspati, the Brahmana, advisor to the Gods, and Indra, the Kshatriya, the king of the Gods.

Read about the cast system here