Bring a pot of salted water to a boil. Cook the spaghetti according to the package directions until al dente.
Before draining the pasta, reserve a small cup of pasta water. Drain the spaghetti and set aside.
While the pasta cooks, melt the butter in a large frying pan over medium heat.
Add the diced onion and kale. Cook for 4-6 minutes, stirring occasionally, until the onion softens and the kale begins to wilt.
Add the minced garlic and drained sardines. Cook for another minute, gently breaking the sardines into smaller pieces as you stir.
Pour in the white wine and simmer for about 1 minute.
Turn off the heat. Add the cooked spaghetti, chopped olives, and pesto.
Pour in a splash of reserved pasta water and toss everything together until the noodles are coated. Add more pasta water as needed to loosen the sauce.
Taste and season with salt and black pepper if needed.
Serve immediately.
Notes
Find ingredients notes, dietary swaps, recipe variations, and more tips in the notes above.