richdynamix / arc

Production ready docker based development environment for your Laravel project.
MIT License
117 stars 18 forks source link

Scalability question #2

Closed RamonSmit closed 6 years ago

RamonSmit commented 6 years ago

Hi There,

Thanks for creating this awesome docker image! It really helps me out with my website.

I have a small question about the image. I'm running it in Rancher and want to scale to more then one instance, but the idea of multiple horizon instances and crons creeps me out.

Is there a way to enable horizon/cron to one instance?

With kind regards, Ramon

richdynamix commented 6 years ago

Sure, you would have one master pod that can set the environment variables for CRON and Horizon while your replica pods would not. This can be done via your Kubernetes configuration.

From here -https://github.com/richdynamix/arc/blob/master/tools/docker/usr/local/share/env/20-arc-env#L3-L10 you can determine which are on and off per environment.

RamonSmit commented 6 years ago

That sounds like a brilliant idea. Just one worker pod for handing CRON and Horizon and just some Web pod-workers!

I'm going to try this out! Thanks for the feedback!

richdynamix commented 6 years ago

No worries, your welcome.

RamonSmit commented 6 years ago

Fought with this, got it working now! Thanks!