Rheem 21i40dv Shooting Hot Water From Top

I have a Rheem 21i40dv that started shooting water from the top connection last night. We have turned off the gas to the water heater and of course, turned the water heater off to prevent the water from shooting. As you can see from the pictures, I need a new connection it looks like. Or maybe it just need to be cleaned due to the corrosion. Can anyone help me through the process of replacing or cleaning?

That's bee leaking a long time.
You need to pinpoint the source of the leak. If it's from the flex connector, replacing that will do. Or it could be from the nipple going into the tank.
Worst case, it's from the tank.