Changing cassette from 8 to 10 or 11 to meet the Shimano 105 5800 groupset I upgraded following parts to Shimano 5800 (front and rear derailleurs, crankset, chain, STI shifters). The last thing left to replace is 8 speed Shimano CS-HG51 cassette. Unfortunately I cannot index the new 105 5800 shifter with this cassette. I guess the space between the rear cogs are not the same as in 10/11 cassettes.
Could you please confirm that?
Also do I need specific 11 cassette for my Shimano 105 5800 group or maybe 10 would be enough? Changing to 11 would force me to change the hub as well, as it is only compatible for 10 cassettes.
Yes, 8/9/10/11 cassettes have different cog spacing.

You have several options:


Replace freehub body to Shimano/SRAM 11 speed compatible, if hub manufacturer provides such an option. It's 1.85mm longer than 8/9/10.
Replace freehub body with Campagnolo one. The trick is that all 11 speed cassettes are cross compatible, but Campy freehub body has same width for 10/11 speeds.
Use 10 speed cassette. This blog entry states that works good enough after some derailleur and cable tension adjusment.
Use 11 speed cassette without one cog and using additional spacer.