The frame is the same and G20 mags will work in a G21 frame.
The factory recoil spring assemblies are the same, 17 lbs, but it is common for G20 owners to run heavier springs. I am running a 20 lbs ISMI in my Gen III G20. Not uncommon to see 22 or even 24 lbs springs.
The main difference in slide dimensions. The .45 ACP runs at 21000 PSI, 23000 for +P. The 10mm is running at 37500 PSI. So while the exterior dimensions are the same, the G20 slide is thicker internally, and more beefy.
You would need a new barrel and almost certainly a new recoil assembly. If people run 20 to 24 pound springs with the heavier slide of the G20, I would think one would be mandatory for proper function with lighter slide of G21. I believe over at GlockTalk they also recommend G20 ejector. This will require detail stripping the frame, but this isn't a big deal with the Glock.