The integrability of the geodesic flow on the three-folds M 3 admitting SL(2, R)-geometry in Thurston's sense is investigated.The main examples are the quotients M 3 Γ = Γ\P SL(2, R), where Γ ⊂ P SL(2, R) is a cofinite Fuchsian group. We show that the corresponding phase space T * M 3Γ contains two open regions with integrable and chaotic behaviour. In the integrable region we have Liouville integrability with analytic integrals, while in the chaotic region the system is not Liouville integrable even in smooth category and has positive topological entropy.As a concrete example we consider the case of modular 3-fold with the modular group Γ = P SL(2, Z), when M 3 Γ is known to be homeomorphic to the complement in 3-sphere of the trefoil knot K. Ghys proved a remarkable fact that the lifts of the periodic geodesics on the modular surface to M 3 Γ produce the same class of knots, which appeared in the chaotic version of the celebrated Lorenz system. We show that in the integrable limit of the geodesic system on M 3 Γ we have the class of the satellite knots known as the cable knots of trefoil.