Distinct lsphp, ols and php contents containers
Hi, I want to distinct the OLS, LSPHP and my website PHP codes images into separated containers (pods) to run in Kubernetes. And link between them to communicate.
When using Nginx, we can do this approach by separating Nginx, PHP-FPM and Dockerfile (main php codes) into distinct images.
Is there any workaround about this? Thanks
Hi, I want to distinct the OLS, LSPHP and my website PHP codes images into separated containers (pods) to run in Kubernetes. And link between them to communicate.
When using Nginx, we can do this approach by separating Nginx, PHP-FPM and Dockerfile (main php codes) into distinct images.
Is there any workaround about this? Thanks
Hi 👋
As far as I know, OpenLiteSpeed (OLS) and LSPHP are tightly coupled via LSAPI, so they typically run in the same container.
Unlike Nginx + PHP-FPM, it’s not really possible to split them completely because OLS handles PHP internally through LSAPI instead of FastCGI.
A common approach is to keep OLS + LSPHP in one container and mount your PHP application from another image or volume.
That way you can still separate the app code from the web server layer in Kubernetes.
Hope this helps!
OLS support namespace now. The easy solution is just enable namespace for each site, so PHP for each site will run in its own container. OLS runs in the host. https://docs.openlitespeed.org/config/advanced/namespaces/