The Pens are currently over the cap by about $2M, but by the sounds of things, they'd like to trade the final two seasons of
Jeff Petry's contract, which carries a $6.25M cap hit. They're also considering a potential buyout, which would allow them to free up enough space to bring in Karlsson without a significant amount of retention by the Sharks.
Mikael Granlund and his $5M cap hit for two more seasons could make sense as a potential buyout target.