The ventricles are structures that produce cerebrospinal fluid, and transport it around the cranial cavity. They are lined by ependymal cells, which form a structure called the choroid plexus. It is within the choroid plexus that CSF is produced.

Embryologically, the ventricular system is derived from the lumen of the neural tube.

In total, there are four ventricles; right and left lateral ventricles, third ventricle and fourth ventricle.

Cerebrospinal fluid is produced by the choroid plexus, located in the lining of the ventricles. It consists of capillaries and loose connective tissue, surrounded by cuboidal epithelial cells. Plasma is filtered from the blood by the epithelial cells to produce CSF. In this way, the exact chemical composition of the fluid can be controlled.

Drainage of the CSF occurs in the subarachnoid cisterns (or space). Small projections of arachnoid mater (called arachnoid granulations), protrude into the dura mater. They allow the fluid to drain into the dural venous sinuses.

More Info: teachmeanatomy.info