In many engineering systems, aside from the main component fulfilling the essential functions, a number of auxiliary components are configured to protect the main component and improve the reliability of the system. In actual operation, the failure or state change of the auxiliary components may affect the reliability both the main component and the remaining operational auxiliary components. However, the structure and dependence between the auxiliary components has been ignored in the existing studies. To fill this gap, we consider a system with a main component and a protective auxiliary subsystem. The latter is a load-sharing <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"><tex-math notation="LaTeX">$\bm{k}$</tex-math></inline-formula> -out-of- <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"><tex-math notation="LaTeX">$\bm{n}$</tex-math></inline-formula> system, that is, there is dependence between the auxiliary components. For such a system, an opportunistic inspection and preventive maintenance strategy is proposed. Then, we derive the system reliability using the Laplace transforms and the matrix method. The long-run average cost of the system is then derived, based on which the optimal maintenance problem is formulated and solved by an enumeration method. A numerical example, together with sensitivity studies of some model parameters, shows how the evolution of the parameters influences the optimal maintenance strategy. Finally, the model is extended by introducing periodic inspection and preventive maintenance strategy for main component, and the two strategies are compared.