To who? In who's eyes is it legal, ethical or moral?
The International Criminal Court for one???
It allows Nuclear weapons but bans landmines.
Does the Geneva Convention ban landmines? I think you'll find that is the Ottawa Treaty.
Then why is the pilot armed?
Right of self defence.