This paper aims to integrate a two-period condition-based preventive maintenance (TP-CBM) into a pull production system by using Kanban control policy. The pull system is subject to continuous degradation and random failures. It is assumed that the system’s degradation can be divided into several stages, where the hazard rate increasing factor is introduced to describe the failure rate at each stage. Meanwhile, quality of products is also considered. Markov chain is used to formulate the process of degradation and periodic inspection policy is adopted to trigger the preventive maintenance. A mathematical model is proposed to obtain the optimal production control and maintenance policies, i.e. the inspection rate, the amount of Kanban and the preventive maintenance threshold. A genetic algorithm combined with integer programming is proposed to solve the problem. Numerical instances indicate that the proposed TP-CBM policy is effective and efficient.