According to 1 Chronicles 12 some Levites went to join David in his fight against raiding parties and turning the kingdom over to him.
1 Chronicles 12:26 NIV
26 from Levi—4,600, 27 including Jehoiada, leader of the family of Aaron, with 3,700 men, 28 and Zadok, a brave young warrior, with 22 officers from his family;
In the previous narrative the Levites had been set aside doing work of the tabernacle
Numbers 3:5-9 NIV
5 The Lord said to Moses, 6 “Bring the tribe of Levi and present them to Aaron the priest to assist him. 7 They are to perform duties for him and for the whole community at the tent of meeting by doing the work of the tabernacle. 8 They are to take care of all the furnishings of the tent of meeting, fulfilling the obligations of the Israelites by doing the work of the tabernacle. 9 Give the Levites to Aaron and his sons; they are the Israelites who are to be given wholly to him.[a
Did the Levites participate in David's wars?