The two rarely go together. But...
1. military: Heinlein's Starship Troopers, NOT that f***ed up movie, 1959; more of a juvenile directed book, but good concepts.
2. military: Dickson's Dorsai series, 1959; originally short stories but later consolidated into books.
3. espionage: Anderson's Flandry series, 1951; several novellas and full novels; James Bond in the30th centry (or so).
4. military: start with Drake's Hammer's Slammers, 1979; this restarted military sci fi.
5. military: Bill Baldwin's Helmsman series, 1985; a guilt pleasure of unabashed space opera.