Asking reference letter earlier or later if I need to go mandatory service for my country
I would suggest explaining your situation to the professor and asking him to write the letter now.

Later on, if you do manage to do some extra work you can ask him to revise the reference letter. The revisions will be quick and easy, but writing a reference letter from scratch after two years might be difficult.

The professor should not be disappointed if he writes the letter but you decide not to continue in academia. A good reference letter will also be very useful when applying for other jobs.