2 Samuel - Chapter 5
In this chapter all the tribes came to David and recognised him as their King. They said to him:
"the Lord said to you, ‘You shall shepherd My people Israel, and be ruler over Israel.’ ” Therefore all the elders of Israel came to the king at Hebron, and King David made a covenant with them at Hebron before the Lord. And they anointed David king over Israel.
David's role as king was named by God as a shepherd. This not only links back to the days when David was looking after his father's sheep. It also looks forward to the King of Kings who named himself as the Good Shepherd:
“I am the good shepherd. The good shepherd gives His life for the sheep.