I'm sure there is a flame sensor that detects that the heater has ignited. It's usually a metal rod, much like a thermocouple. I just dealt with this problem on my home furnace. Same symptom. Gas turned on flame ignited. Burner ran for 8 seconds then went out.
The suggested fix was to remove the sensor rod and clean it with steel wool or fine emory paper. Most of the time that fixes the problem. If it doesn't, you replace the sensor.
Now I'm making a stretch here that the water heater has the same components. My trailer is up at the storage lot so I can't just jump outside and check it out. But this is a cheap fix and if it works (it did on my furnace) you save a few $$.
'04 Classic 30' S.O.,'03 GMC Savana 2500,'14 Honda CTX 700