At stumps on the first day, hosts Karnataka were strongly placed at 326 for the loss of four wickets at the M Chinnaswamy Stadium.
Shreyas Gopal was batting on 88 at the close of play and, in the company of the in-form Rahul, added 178 runs for the fifth wicket.
Uttar Pradesh won the toss and elected to field, hoping to utilise early morning's helpful conditions, but that was not to be as Karnataka rode on Lokesh's 256-ball knock and his 80-run partnership with Robin Uthappa (41).
However, there was no trouble for Karnataka thereafter as the duo of Rahul and Gopal frustrated the visitors with their composed batting.
More From This Section
Rahul, who had scored a century in only his second Test for India against Australia at Brisbane earlier this month, struck 22 boundaries and a six.
While Gopal's knock was studded with 15 hits to the fence.
The experienced Praveen Kumar was the most successful bowler from the Uttar Pradesh outfit, the skipper returning figures of 3/34.
Brief scores:
Karnataka 1st innings: 326/4 in 90 overs (KL Rahul batting 150, Shreyas Gopal batting 88; Praveen Kumar 3/34).