When Google had initially announced the Pixel 2 lineup, it had promised two years of OS updates for them. However, after the company updated the original Pixel to Android 10 -- their third major OS updates, many believed the Pixel 2 would also be given the same treatment. This was confirmed when Google launched the Android 11 developer preview for Pixel phones which included the Pixel 2 series.
Now, comments made in AOSP from Google developers confirm that Android 11 will be the last OS update for the Pixel 2 series and that the company is preparing to drop support for devices after that. This means that once Google rolls out Android 11 update for the Pixel 2 and Pixel 2 XL, it will stop rolling out any new updates for them. It might release one or two security patches after Android 11 is released to fix some bugs and patch some security loopholes, but that will be about it.
AOSP comments also confirm that Google will launch the Pixel 4a with Android 10. This means that the device will get OS updates until 2023 or just before Google prepares to release Android 14. However, this is speculation and the company can always possibly extend OS support for the device.