Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Terraform and Ansible for Docker Swarm Cluster Installer in Proxmox

Features:

  • Automatically detect host's OS Distribution
  • Multi-Master Docker Swarm

System version:

  • Docker Engine Version: latest (Engine: 20.10.14, Client: 20.10.14)
  • Containerd Version: 1.5.11

System requirements:

  • Localhost (Linux, Windows with WSL, or MacOS) with:

    • Ansible 2.10.1+
    • Terraform v1.1.+
    • Telmate/terraform-provider-proxmox Plugin for Terraform (automatically installed when we initiate terraform)
    • Sshpass
    • Docker-cli (for remote docker control)
  • Proxmox Server (v7.1-x)

    • Cloud-Init template for VM creation
    • API Token for accessing Proxmox
  • Remote hosts(Proxmox VMs):

    • All Docker hosts must have SSH installed
    • All Docker hosts must have passwordless SSH access (will be configured with ssh-copy-id, initiate our host with ssh-keygen first if we dont have public ssh key)
    • Supported Distros = all distros that are supported in this Docs (https://docs.docker.com/engine/install/)
    • All Docker hosts must have sudo/root access for Docker installation

How to run all of the stacks

  • First, change your directory to Terraform
  • Configure all the needed variables and the amount of the vms in variables.tf
  • To modify the spec of the vms, configure it in main.tf
terraform init
terraform plan
terraform apply
  • To delete the Cluster and hosts
terraform destroy

For running Ansible only (for installing Docker Cluster in multiple hosts)

  • Change your directory to Ansible
  • Rename Hosts.tmp to Hosts
  • Configure the hosts we want to install
ansible-playbook main.yaml

For running Docker Apps

  • After running the terraform init, go to Docker folder
  • you can create docker resource with generated dockerssh file, ie:
bash dockerssh run -d --name my-nginx nginx:latest
bash dockerssh stack deploy --compose-file docker_service.yaml my_service

About

Terraform and Ansible for Docker Swarm Cluster Installer in Proxmox

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages