Formal:
* Nasa hukbong sandatahan ka ba? (This is the most direct and formal translation.)
Informal:
* Kasama ka ba sa hukbo? (This is a more casual way of asking.)
* Sundalo ka ba? (This literally means "Are you a soldier?" and is a common way to ask if someone is in the military.)
To be more specific, you can also ask:
* Nasa [branch of the military] ka ba? (e.g., Nasa Hukbong Panghimpapawid ka ba? - Are you in the Air Force?)
* Anong sangay ng militar ang kinabibilangan mo? (What branch of the military are you in?)
The best translation will depend on the specific situation and who you are talking to.