The chemical reactions and pathways involving ecdysteroids, a group of polyhydroxylated ketosteroids ubiquitous in insects and other arthropods, in which they initiate post-embryonic development, including the metamorphosis of immature forms and the development of the reproductive system and the maturation of oocytes in adult females.