The Yankees were worried about their rotation in spring training — their 2018 rotation.

Recall that the Yankees were trying to win this year, but much of their focus for being a serial contender revolved around 2018 and beyond.

When pitchers and catchers showed up, the Yankees had three veteran physical concerns who all could be free agents after the 2017 season — Michael Pineda (remember him?), CC Sabathia and Masahiro Tanaka.

They had a five-neophyte battle for the final two rotation spots. They wanted Luis Severino to earn one of them, but he had been one of the majors’ worst starters in 2016 (0-8, 8.50 ERA in 11 starts) and had done so well in relief there was a groundswell to just leave him there.

The Yankees had so liked the development of Luis Cessa’s secondary stuff in 2016 that he was viewed as the favorite for the fifth spot over Chad Green, Bryan Mitchell and Adam Warren. But Cessa arrived in less than ideal shape, never seized the moment and, really, neither did the others. Instead, Jordan Montgomery — non-roster and afterthought when the spring began — won the final spot.

The red-flag worries proved valid on Pineda, who needed Tommy John surgery after 17 Pineda-esque starts — ricochets between terrific and terrible. But the other four starters all made at least 27 starts — even with DL stints for Sabathia and Tanaka. Sonny Gray was obtained at the trade deadline and by the end of the season the rotation was a strength — the Yankees’ 3.98 rotation ERA the second best in the AL behind the Indians (3.52).

Now, projections look better for 2018 as well — better than the Yankees could have hoped for when they gathered last at Steinbrenner Field.

Severino almost certainly will finish in the AL Cy Young top five. Montgomery could finish in the AL Rookie of the Year top five.

The Yankees have run away from Gray this postseason, but they believe he will be better next year with the acclimation to New York and this organization period gone. It will be interesting if Gray can begin to win over the fan base with strong work in ALCS Game 4 on Tuesday night.

Gray’s age (27) and lower salaries are why the Yanks focused on landing him in July over Justin Verlander, who has outpitched Gray in his new environment and dominated ALCS Game 2 for the Astros. With Gray, Severino (23) and Montgomery (24), the Yankees believe they have a rotation cornerstone the next few years.

Tanaka can opt out of the final three years at $67 million of his contract, but the general sense is he won’t. He reminded late this season that he is still a high-end starter, undone through a bulk of 2017 by the home run craze of this season. With all the worries about his elbow, Tanaka has made 61 starts the past two seasons, the same as, for example, Jake Arrieta and Corey Kluber. He turns 29 in two weeks.

If the Yanks bring back Severino, Gray, Tanaka and Montgomery — and Tanaka must declare his intentions within three days after the World Series concludes — they can be deliberate how they act the rest of the offseason. Though they plan to push as hard as possible to secure Shohei Otani, the 23-year-old Japanese star.

As the Mets have demonstrated with the dissolution of their expected super rotation, it is hard to forecast too far ahead when it comes to something as fragile as starting pitching. But if Tanaka stays and Otani is signed, the Yankees’ rotation would, in the short and long term, be in as good a shape as any time since the Joe Torre dynasty years. From where they were last March, that would be remarkable.

The Yanks could still try to retain Sabathia for, say, $7 million-to-$10 million as both sage and starter, and my sense is that the veteran lefty does not want to uproot from New Jersey and would lean toward staying. In that scenario, Montgomery could be kept at Triple-A for depth along with Domingo Acevedo, Chance Adams and Justus Sheffield — a trio with a chance to be on most top-100 prospect lists to begin next season.

The Yanks also can try to do with Green, 26, what they did with Severino — use a dominant tour as a reliever as a platform to put him back in the rotation and see what happens. I suspect he will be asked to show up in spring ready to start, with the idea that he can always be returned to the pen – in other words the annual move with Warren.

No matter what, as they try to rally in the ALCS and extend this season, the Yankees rotation already looks far better positioned for March 2018 than it did a year earlier.