“Colonel” is pronounced just like “kernel.” How did this happen? From borrowing the same word from two different places. In the 1500s, English borrowed a bunch of military vocabulary from French, words like cavalerie, infanterie, citadelle, canon, and also, coronel. The French had borrowed them from the Italians, then the reigning experts in the art of war, but in doing so, had changed colonello to coronel.
Why did they do that? A common process called dissimilation—when two instances of the same sound occur close to each other in a word, people tend to change one of the instances to something else. Here, the first “l” was changed to “r.” The opposite process happened with the Latin word peregrinus (pilgrim), when the first “r” was changed to an “l” (now it’s peregrino in Spanish and Pellegrino in Italian. English inherited the “l” version in pilgrim.)
After the dissimilated French coronel made its way into English, late 16th century scholars started producing English translations of Italian military treatises. Under the influence of the originals, people started spelling it “colonel.” By the middle of the 17th century, the spelling had standardized to the “l” version, but the “r” pronunciation was still popular (it later lost a syllable, turning kor-o-nel to ker-nel). Both pronunciations were in play for a while, and adding to the confusion was the mistaken idea that “coronel” was etymologically related to “crown”—a colonel was sometimes translated as “crowner” in English. In fact, the root is colonna, Italian for column.
Meanwhile, French switched back to “colonel,” in both spelling and pronunciation. English throws its shoulders back, puts its hands on its hips and asks, how boring is that?