I want to know how to get a 10km egg. I like the 2km and the 5km, but I want a 10km as well. I have been collecting 2km and 5km all the time, but I don't know where the much rarer 10km are.
A 10km egg is obtained randomly from a PokeStop. There are no other requirements other than spinning the PokeStop.
Similar to 2km and 5km eggs, you have a chance of receiving a 10km egg from any PokeStop. There are no requirements to obtain the egg other than spinning the PokeStop, but you'll notice that they are generally significantly more rare than the other eggs. The location of the PokeStop or your level does not matter (or at least has not yet been proven to matter).
There isn't much factual data on the rate of obtaining the eggs as of now. You can read an interesting discussion about the rate here, but consider this as a discussion and not a source of reliable data. There are many theories but nothing has been confirmed. You may be able to find an Excel sheet in the depths of the Internet that backs up the 4% chance mentioned in that thread, or you could create your own and calculate your results.
I get 10km eggs when I have hatched all my 2km eggs and there are only 5km eggs left to hatch. I have tested this theory four times now and always end up with a 10km egg. Normally as soon as the last 2km egg hatches and there are eight 5km eggs ready for hatching I will receive a 10km egg at the next Pokestop. You may not need eight 5km eggs, but that's what I always appear to have. So hatch all your 2km eggs and see what happens!