Sir Keir Starmer set out plans for defence spending to reach 2.7% of gross domestic product in 2027.