terraform: automate deployment
Closed this issue · 0 comments
Ivshti commented
A lot of things were done on the fly on the current setup and not automated.
Automate them:
- setup the swarm on all the swarm servers, deploy the initial stack (the registry) by running
beamup-sync-and-deploy
- swarm syncing through ssh (to allow the dokku plugin to trigger syncs); to implement this, just add to
.ssh/authorized_keys
on the swarm manager:command="beamup-sync-and-deploy",restrict,permitopen="localhost:5000" KEY dokku@stremio-addon-deployers
, where the key is the main key of the deployer - service for a ssh tunnel of port 5000, opened from the deployer to the swarm manager, so that the deployer can access the registry that's running on the swarm manager
- nginx logrotate (comes preinstalled + proper config)
- install the dokku plugin:
dokku-plugins/beamup-trigger-swarm-sync
- symlinking to /var/lib/dokku/plugins/enabled should do the job - cron script to run
docker prune
and registry garbage-collect on the deployer (docker prune
may be needed on the swarm servers too) - disable swap: can cause issues with docker; although this might be sufficient: 0caa93b
- ssh hardening: do not permit root login, disable password login, create user beamup + ssh keys, login
- iptables/iptables-restore setup
- configurable domain; take the domain as a input option