Begin with a cylinder. or make your own with the gradient tool.
If you make your own, set the gradient to reflected and linear.
Here is where it all happens:
Filter>Spherize set the amount to 100 and change the mode to horizontal only.
See how it looks distorted?
Press Ctrl/Cmd+T for free-transform.
Drag the sides in until it matches the size of the shape.
If you want a more rounded look on the ends of the cylinder:
Make a huge selection with the circular marquee tool.
Invert the selection. Ctrl/Cmd+Shift+I
Now use the eraser tool to erase the corners away.