On the first day of training camp last week, Avalanche defenseman Erik Johnson said he would talk about his contract situation that one time — and then turn aside questions on it from then on as he focused on hockey.

“It’s my desire to stay here, but it has to work for both sides and I’m all for working with the team and trying to fit into the structure,” he said then. “I’m not out to get something over my value on the market. I’m going to work with them and I hope they work with me and we can get something done.”

“They” — the Avalanche and Johnson’s camp — got something done.

Two hours before opening the exhibition season Tuesday night against Anaheim at the Pepsi Center, the Avalanche announced the signing of Johnson, 27, to a seven-year, $42 million contract extension that locks him up through the 2022-23 season.

Johnson, 27, is under contract for the upcoming season, at $4.25 million, but could have been an unrestricted free agent July 1 if he didn’t re-sign with Colorado. Because the contract is neither front- nor back-loaded, paying him $6 million a year, the cap hit and his salary will be the same each season.

Most inferred that Johnson’s reference to “structure” was about former teammate Ryan O’Reilly, traded to Buffalo in the offseason when it became clear he and the Avalanche were going to be unable to come to terms on an extension and the team would risk losing him to free agency next summer. Johnson said that interpretation wasn’t correct.

“For me, it was just we have a lot of guys coming up who are definitely going to have some raises,” Johnson, who didn’t suit up against Anaheim, said after the first period. “I don’t want to say it’s not about the money, because that’s what you negotiate over, but I wanted to fit in and make sure we could get other guys signed, too.”

Winger Nathan MacKinnon and defenseman Tyson Barrie are the major Avalanche players entering the final year of their deals, but they would only be restricted free agents — not unrestricted — next summer if they don’t sign extensions.

Johnson noted: “The biggest thing was that I wanted to think about just playing for this team. I didn’t want to … come into the locker room and talk about my contract, I wanted to talk about the team and the team only. And now that we have it out of the way, we can focus on the hockey season and focus on winning hockey games, which is clearly the most important thing.”

The deal takes him to age 35.

“It makes me cringe,” he said. “This is my ninth year coming up here, and to think about taking me to that age … I remember breaking in as a 19-year-old and playing with Keith Tkachuk, who was that age, and I thought he was so old. I’m sure that when I’m that age, when I finish this contract here after we’ve won a few Stanley Cups, there’s going to be some young 18-year-old looking at me, saying, ‘Look at that old guy.’ It’s crazy how time flies. You have to appreciate that we’re so lucky to come to the rink every day and do this for a living.”

Johnson, the first overall choice in the 2006 NHL draft, right before he played one season for his hometown University of Minnesota Gophers, came to the Avalanche in a February 2011 trade from St. Louis.

The 2010 U.S. Olympian has had his ups and downs with the Avalanche, but last season seemed to be stepping up to the cornerstone, elite status predicted for him before he underwent arthroscopic knee surgery in January and missed the final 34 games. Still, he finished with a career-high 12 goals last season and averaged 24:25 of ice time.

“He really wanted to be here, we really wanted him here,” Avalanche executive vice president/general manager Joe Sakic said Tuesday night. “We were able to find a solution. … He’s an Avalanche and wants to be here for the rest of this career.”

Sakic added, “He was out one UFA we wanted to get done and we know we have some other guys (Barrie and MacKinnon) … and we’re going to have talks with both of their representatives. They’re RFAs, so they’re not going anywhere.”

Terry Frei: tfrei@denverpost.com or @TFrei