A multiple 100's percent kernel_task CPU usage generally means your Mac is overheating. When the intel chip gets too hot, the kernel_task will put the chip into a low power idle mode so it can cool down. Because the kernel_task is keeping control of the CPU for an extended period of time, the scheduler thinks the kernel_task is using a lot of CPU, when in fact it is trying to keep the intel chip from melting inside (literally).
You can have excessive heat from:
- failed fans
- dust/pollen accumulating in the fans and on heat sinks
- apps that use excessive amounts of non-stop CPU and GPU
- apps that use excessive amounts of memory forcing the Mac to do paging and swapping, bringing the storage device into the game generating heat that has to be removed
- a Mac that has its cooling vents blocks (generally not an iMac situation, but I do not know what you have around the vents of your iMac)
- an overly hot (and humid) room (we are talking no air conditioning in the middle of 100+ degree summer days, with the sun shining on the iMac kind of overly hot room.