When you're saying "Putin invaded Ukraine irrationally" you're implicitly projecting your own value system and worldview onto him.
Let's take goals. What do you think Putin's goals are? I don't think it's too fanciful to imagine that welfare of ordinary Russians is less important to him than going down in history as someone who reunited the lost Russian Empire, or even just keeping in power and adored. It's just a fact that the occupation of Crimea was extremely popular and raised his ratings, so why not try the same thing again?
What about the worldview? It is well established that Putin didn't think much of Ukraine's ability to defend, having been fed overly positive reports by his servile underlings. Hell, even Pentagon thought Ukraine will fold, shipping weapons that would work well for guerrilla warfare (Javelins) and dragging their feet on stuff regular armies need (howitzers and shells). Russians did think it'll be a walk in the park, they even had a truck of crowd control gear in that column attacking Kyiv, thinking they'll need police shields.
So when you put yourself into Putin's shoes, attacking Ukraine Just Makes Sense: a cheap&easy way to boost ratings and raise his profile in history books, what not to like? It is completely rational — for his goals and his perceived reality.
Sadly, people often fall into the trap of overextending their own worldview/goals onto others, finding a mismatch, and trying to explain that mismatch away with semi-conspiratorial thinking (Nato expansion! Pipelines! Russian speakers!) instead of reevaluating the premise.