Maybe similar question was asked before, because problem should be common for many IT companies, but probably I can not guess right terms to find it.
Current siuation: We have a rack with few servers in datacenter and we host hundreds of websites for many customers on it. Reliability is in priority, so servers are brand-name, with expensive warranty. Most websites (lets say ‘all’) are quite similar (PHP, MySQL (sometimes 2+ accounts), LetsEncrypt SSL certificate, Rewrite rules in Apache VirtualHost).
Problem: We pay a lot for these servers and we want to cut our expenses. Personally, I use few low-cost VPSes for other project and quite satisfied with it. But we cannot afford long downtime even once in year.
Main idea: I’m thinking about getting few fast and cheap (but maybe not very reliable) nodes (physical or virtual servers) and install some magical ‘orchestrator’ on it. Some websites will be on node A, some on node B and some on node C. And all websites must be up even if some nodes are down. Instead of spending money on preventing problems, I want to use technology to mitigate problem and cut downtime almost to zero.
Feature: Backup/Repository: Each website would be packed in some unified package format and available from git/http/ftp repository. Maybe this tool would make daily backups (e.g. mysql dump) and upload packages to repository.
Feature: Quick recovery: Now, if node A goes down, I should be able to put website on other node with few commands. (Website files, database and db users/grants, apache virtual site cofiguration, LetsEncrypt certificates would be automatically downloaded from repository (from master package or last backup package) or (ssl cert) generated on new node ). Maybe even orchestrator itself would automatically run this command for me.
Seems Docker/LXC containers aren’t useful for this purpose, because all sites uses same technologies, and I rather need orchestrator for sites. K8s seems for opposite situation (hundreds of identical nodes) while I need hundreds of nodes, each with different website content (but identical technological stack). But maybe k8s is good for this and I just have wrong idea about it?
Anyway, since main idea of this is to cut expenses, solution should be lightweight, each server must take almost same load as if without that orchestrator, as if admin would manually install/configured each site.
Does some technology already exists for this purpose? (I even built prototype scripts myself, which automatically downloads website from repo, configures apache, gets LetsEncrypt certs etc. – but I’m afraid I’m just reinventing wheel). Maybe websites control panels (like Plesk) has some similar feature? (I never used it because always configured everything from CLI).