In application scenarios with lower ambient temperatures and higher sink temperatures, the trans-critical CO2 heat pump water heater system using an ejector instead of a conventional expansion device offers better performance, and the higher pressure differential allows for partial pressure loss recovery through the ejector. However, the complexity of discharge pressure and ejector matching affects the further application of the system. Therefore an optimization method called Extremum seeking control method is proposed to achieve the lowest power consumption implementation under off-design conditions. The ESC controller applied to the system uses the compressor power consumption as the feedback signal and the discharge pressure is used as operating input set-point. The dynamical model of a trans-critical CO2 heat pump water heater built on Modelica/Dymola is used as the study object and optimized for three scenarios: fixed, sloped step profile, and actual ambient temperature. The simulation results show that the ESC applicable to the proposed system can optimize the matching of discharge pressure and ejector driving nozzle throat area to obtain the best performance. Compared with the benchmark system, the extremum seeking control for actual ambient temperature conditions results in a 5.7% increase in system efficiency.