Brother...knocking and RPM fluctuation these are two different scenarios with different possible reasons.....if RPM is fluctuating, its typically a throttle body issue, keep it clean or serviced by some experienced guy....clean the air filter, for Knocking check the spark plugs with coils ( i doubt on coils for 2017 model) but yes spark plugs maybe the culprit....if all ok then i doubt on fuel pump as it also registered as one of the manufacturing problem in some cars...fuel is not properly supplying on low speeds....
rest get it a thorough check by some good dealer....