Assuming that the training agreement itself is legal and valid, the unit has paid the training fee of 30,000 yuan and agreed on a three-year service period, the maximum penalty is 30,000 yuan, which shall not exceed the expenses to be shared during the non-service period. For example, if the service period has been fulfilled for two years, and one year has not been fulfilled, then the employee will have to pay a penalty of 10000 yuan if he leaves early due to resignation. If the service period has been fulfilled for 2.5 years, the penalty is 5,000 yuan.