7. The maximum value of the function $y=\cos ^{3} x+\sin ^{2} x-\cos x$ is ( ).
(A) $\frac{32}{27}$
(B) $\frac{16}{27}$
(C) $\frac{8}{27}$
(D) $\frac{4}{27}$
7. A.

The original function can be transformed into
$$
y=\cos ^{3} x-\cos ^{2} x-\cos x+1 \text {. }
$$

Let $t=\cos x$. Then $t \in[-1,1]$.
By using the derivative method, the maximum point is found to be $t=-\frac{1}{3}$. Therefore, the maximum value of the function is $\frac{32}{27}$.