Water hammer most likely.    Put a 1 litre expansion vessel on the cold inlet to the water heater (assuming its in a cupboard..?)