Shifters (the right one, actually), rear cassette and chain go together. IOW, you need a 9-speed shifter to shift a 9-speed cassette, whereas you need an 8-speed shifter to shift an 8-speed cassette. And since cogs are closer to each other on a 9-speed drivetrain, you need a 9-speed chain on a 9-speed cassette. OTOH, you could use a 9-speed chain with an 8-speed cassette, even though it usually doesn't make sense ($).
But derailleurs, front shifter and crankset are totally blind to the number of gears you have in the back.