Ukraine, unfortunately, was Russias red line for further NATO-expansion.Ukrainans are russians property or if in best case vassals according to rus.
I even agree that they should not had attempted to establish ties with west.
Best safety solution might had been to cede Donbas for China, some areas for Allah and etc.
However they should had did this before 2010 th
...
Ukraine (and NATO) was well aware of that, that's why their previous regimes never openly entertained the idea of joining NATO.
When you're a neighboring country to a super power, you can't just do what you please.
Your best bet is to try to have a neutral/positive relationship with both power structures, without crossing any red lines.
Ireland likely wouldn't be allowed by the UK to host north Korean nukes, just as Cuba wasn't allowed by the USA to host Soviet nukes, just as Russia wasn't thrilled about potentially having NATO-bases and nukes in Ukraine in the future.