The 30-year-old will officially join the Millers on July 1 after his contract at Colchester expires and he joins fellow striker Daniel Nardiello at the club after the Welsh striker signed from Exeter last week.
"I am delighted with this signing and I have to say we have beaten a number of good clubs to get him here, but with the fantastic New York Stadium and the big support we have here I always believed we stood a chance," boss Steve Evans told the club's official website.
"Kayode is a real handful for any defence and he has been in outstanding form. He is powerful, quick and outstanding in the air and we all look forward to working with him.
"At times the lad single-handedly produced performances that kept Colchester in the League One promotion race. I know the manager down there very well (John Ward) and I know how highly he rates the lad, so he will be very sorry to see him leave I know that much.
"I spoke with two managers in League One whose team faced Kayode last season. Both of those gentlemen told me it would be in their opinions a fantastic signing as he caused those teams all sorts of problems."