When David appointed his son Solomon as Israel’s king (see 1 Kings 1), he outlined the kingdom's organizational structure and made provisions for the temple's operation.
The account of Solomon’s coronation continues in 1 Chronicles 28–29; the chapters in between (23:3–27:24) detail the kingdom's organization.