sorry, I meant to write: does the can light have to be 6 inches from the closet storage space in a kitchen pantry? 12+6=18 inches from wall -measured on the ceiling.
The only place NEC defines closet storage space and has luminaire clearances from said space relates to "clothes closets" which NEC does have a definition for in art 100.
Clothes Closet & Kitchen are all you will find. Then go back to the definition of Storage Space (I already gave you that location) and think about the three definitions.