Next.js Discord

Discord Forum

How to serve Next Image in a kubernetes cluster?

Unanswered
Irish Red and White Setter posted this in #help-forum
Open in Discord
Avatar
Irish Red and White SetterOP
Serving nextjs as many pods in a kubernetes cluster, how would you go about serving the next image folder (./cache/images) correctly among these pods?

A naive approach we've considered is to simply have a kubernetes volume and mount the folder to a shared volume. But we assume then it's a huge risk with race conditions - two containers simultaneously try to write to the same file while serving the same image on the same page, for example.

Has anyone had any luck with this, or is Vercel the only way to do NextJS without problems?

0 Replies