A team from Cambridge University seems to have the answer why a kettle lets out a whistle as it boils.

The science behind the noise the kettle makes when the water boils can offer an explanation to some other disturbing noises like the sound of trapped air in plumbing pipes or damaged car exhausts.
"Pipes inside a building are one classic example and similar effects are seen inside damaged vehicle exhaust systems. Once we know where the whistle is coming from, and what's making it happen, we can potentially get rid of it."
Scientists found that once water begins to boil in the kettle, the whistle behaves like a Helmholtz resonator. They found that above a particular flow speed, small vortices at certain frequencies produce the all too familiar whistle.
Source-Medindia