Knicks rookie center Luke Kornet couldn’t help but being a diehard Yankees fan his entire life — despite growing up in Arizona and Texas.

His father, Frank Kornet, was best friends with Yankees general manager Brian Cashman at Lexington Catholic High School in Kentucky. Cashman and Kornet played junior varsity basketball together. The elder Kornet went on to play at Vanderbilt and two years in the NBA with the Bucks.

“I’ve rooted for them my entire life,’’ Kornet told The Post.

The preseason hasn’t gone swimmingly for Kornet, sidelined by a hamstring strain. But his beloved Yankees are making it more bearable. When he was a child, he met Cashman, who got the Kornet family tickets to the epic Game 7 of the 2001 World Series in Arizona.

Wednesday night had a decidedly sweeter ending. Seconds after the Yankees advanced to the ALCS, Kornet issued a tweet, requesting the metal sign from his bedroom in Texas be shipped to New York. The sign reads: “Luke Kornet’s Yankee Room.’’

“My room was all navy and white so my parents were in New York and bought it for me and I hung it above my door hinge,’’ said Kornet, who visited Yankee Stadium for the first time for a game two weeks ago.

The undrafted, outside shooter, who starred at Vanderbilt like his father, was a standout on the Knicks summer league team and was signed to the newly instituted two-way contract. It means he’ll shift all season between G-League Westchester and the Knicks.

One night, his favorite Yankee, Aaron Judge, just may appear on the Garden’s celebrity row.

“I’m 7-foot, I’ve always liked tall players,’’ Kornet said.