Share the tomcat/lib folder to all other pods

My Applicaiton is java based Applicaiton and we did the tomcat dockerized applicaiton . we have four 4 application and created the 4 containers . we have comman library for authentication , in all containers we have moved this jar file to /lib folder and applicaiton is looks file .

but when ever changes happen in the jar file , we need to build and deploy the all the containers . is there way do share the jar file to 4 containers and does not required to build and deploy the all the 4 containers . only need to update the jar

Its Like share the tomcat lib folder to another container in kubernetes and when ever chnages happened to jar file automatically replicated to all container .

I don’t really have any recommendation to achieve what you want.

But I would recommend against it anyway. Rebuilding the container images and re-deploying them as you are already doing would be a recommended pattern.

You don’t want to have dependencies on libraries between pods. The idea of containers is they are self contained from dependency perspective. Also you could have a situation where pods are on separate worker nodes so sharing libraries would not work.

Kind regards,
Stephen