Checked water heater operation found pilot light would not stay lit. Checked valve and controls found gas valve not working properly. Replaced gas valve, system cycled on good and is working properly. Also performed maintenance and flush on water heater. Found water connection leaking, tightened all water flex connections and is good and leak free at this time. Also found expansion tank defective, diaphragm in tank has been ruptured and needs to be replaced. Replaced expansion tank and pressurized it to 70 psi per house pressure and is operating good.