Let $R$ be the radius of the sphere and let $h$ be the height of the cylinder centered on the center of the sphere. By the Pythagorean theorem, the radius of the cylinder is given by
$$
r^2 = R^2 - h^2.
$$
The volume of the cylinder is hence
$$
\begin{align}
V &= \pi r^2 h\\
&= \pi (h R^2 - h^3).
\end{align}
$$
Differentiating with respect to $h$ and equating to $0$ to find extrema gives
$$
\frac{dV}{dh}=\pi (R^2 - 3h^2) = 0\\
\therefore h_0 = \frac{R}{\sqrt{3}}
$$
The second derivative of the volume with respect to $h$ is always negative such that the volume is maximal at $h = h_0$. Substituting gives
$$
V_{max}=\pi \frac{R^3}{3} (1 - \frac{1}{\sqrt{3}}).
$$