For the function $f(x)$ to be continuous at $x = \frac{\pi}{2}$, the limit of $f(x)$ as $x$ approaches $\frac{\pi}{2}$ must equal the value of $f(x)$ at $x = \frac{\pi}{2}$. That is, we need to find $\lim_{x \to \frac{\pi}{2}} f(x) = f\left(\frac{\pi}{2}\right) = k$.
Let us first calculate the limit of the function as $x \to \frac{\pi}{2}$ for $x \neq \frac{\pi}{2}$:
\[
\lim_{x \to \frac{\pi}{2}} \frac{1 - \sin^3 x}{3 \cos^2 x}
\]
At $x = \frac{\pi}{2}$, $\sin \frac{\pi}{2} = 1$ and $\cos \frac{\pi}{2} = 0$. Substituting these values into the expression gives:
\[
\frac{1 - 1^3}{3 \cdot 0^2} = \frac{0}{0}.
\]
This is an indeterminate form, so we need to apply L'Hopital's Rule. To apply L'Hopital's Rule, we differentiate the numerator and denominator separately. The numerator is:
\[
\frac{d}{dx}\left(1 - \sin^3 x\right) = -3 \sin^2 x \cdot \cos x.
\]
The denominator is:
\[
\frac{d}{dx}\left(3 \cos^2 x\right) = -6 \cos x \cdot \sin x.
\]
Thus, we have:
\[
\lim_{x \to \frac{\pi}{2}} \frac{-3 \sin^2 x \cos x}{-6 \cos x \sin x} = \lim_{x \to \frac{\pi}{2}} \frac{3 \sin x}{6} = \frac{3}{6} = \frac{1}{2}.
\]
Now, for the function to be continuous at $x = \frac{\pi}{2}$, the value of $f\left(\frac{\pi}{2}\right)$, which is $k$, must equal the limit we just calculated:
\[
k = \frac{1}{6}.
\]
Hence, the correct value of $k$ is $\frac{1}{6}$.