Deploy loadbanaced libreddit with KVM, libvirt, terraform and ansible.
Go to file
2023-07-16 19:53:50 +05:30
ansible feat: deploy loadbalanced libreddit instance 2023-07-16 17:28:34 +05:30
scripts feat: deploy loadbalanced libreddit instance 2023-07-16 17:28:34 +05:30
templates feat: deploy loadbalanced libreddit instance 2023-07-16 17:28:34 +05:30
tests feat: deploy loadbalanced libreddit instance 2023-07-16 17:28:34 +05:30
.gitignore feat: deploy loadbalanced libreddit instance 2023-07-16 17:28:34 +05:30
cloud_init.cfg feat: deploy loadbalanced libreddit instance 2023-07-16 17:28:34 +05:30
conf.tf feat: deploy loadbalanced libreddit instance 2023-07-16 17:28:34 +05:30
Makefile feat: help annotations for Makefile 2023-07-16 19:53:39 +05:30
network_config.cfg feat: deploy loadbalanced libreddit instance 2023-07-16 17:28:34 +05:30
README.md feat: usage instructions 2023-07-16 19:53:50 +05:30
requirements.txt feat: deploy loadbalanced libreddit instance 2023-07-16 17:28:34 +05:30

Load-balanced libreddit deployment

Use KVM/QEMU, Docker, libvirt, Terraform, and Ansible to deploy loadbalanced libreddit and verify deployment with Testinfra.

Dependencies

  1. GNU/Linux host machine
  2. KVM
  3. QEMU
  4. Libvirt
  5. Terraform
  6. Python 3
  7. Ansible
  8. Testinfra
  9. Debian 11 Bullseye qcow2 bootable

Usage instructions

1. Provision resources (VMs) on KVM using Terraform

  1. Generate and verify deployment plan
terraform plan -out=libreddit
  1. Apply deployment plan
terraform apply "libreddit"

2. Verify VMs are reachable from host

make configure.ping

3. Configure VMs

make configure

4. Test deployment

make test

5. Take down deployment

terraform destroy

Functions

Utility scripts exist for the following operations:

19:46 atm@lab iac ±|master ✗|→ make help
configure                      Configure whole deployment
configure.ping                 Ping all VMs
configure.base                 Configure all VMs to base production configuration
configure.libreddit            Configure libreddit
configure.loadbalance          Configure loadbalancer
lint                           Lint source code
on                             Boot VMs
shutdown                       Shutdown VMs
test                           Run all tests
test.base                      Test base configuration on all VMs
test.loadbalance               Test loadbalancer installation
test.libreddit                 Test libreddit installation
help                           Prints help for targets with comments