GithubHelp home page GithubHelp logo

colinwilson / terraform-hcloud-docker-host Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 14.0 34 KB

Terraform module to deploy a single Docker host (in swarm mode) on Hetzner Cloud. A Hetzner Cloud volume is used as the Docker root directory.

Home Page: https://registry.terraform.io/modules/colinwilson/docker-host/hcloud/latest

License: Apache License 2.0

HCL 100.00%
terraform terraform-module docker hetzner hetzner-cloud swarm-mode

terraform-hcloud-docker-host's Introduction

terraform-hcloud-docker-host

A Terraform module to deploy a single Docker host (in swarm mode) on Hetzner Cloud. A separate Hetzner Cloud volume is also created, attached and configured as the Docker root directory. See the variables file for the available configuration settings.

The resources/services/activations/deletions that this module will create/trigger are:

  • Create a server and cloud volume on the Hetzner Cloud Platform
  • Create or use an existing SSH Public Key
  • Installer Docker Compose, Docker and enable Docker Swarm mode

Tutorial

Provision a Docker Swarm Host with Traefik (v2) on Hetzner Cloud using Terraform Modules - Part 1

Compatibility

This module is meant for use with Terraform 0.13 or higher.

Usage

Basic usage of this module is as follows:

module "hcloud-docker-host" {
  source  = "github.com/colinwilson/terraform-hcloud-docker-host"
  version = "~> 0.1.4"

  server               = {
    name               = "docker-swarm-host-01"
    server_type        = "cx11"
    image              = "ubuntu-20.04"
    location           = "hel1"
    backups            = false
  }
  ssh_public_key_name = "my_ssh_key"
  ssh_public_key      = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJNcwP5mhs5/F2T9GFHmg4z6E6sbOG+Ynx2iPERKeOGm"
  volume_size         = 20
  volume_filesystem   = "xfs"

}

A Functional example is included in the examples directory or clone the docker-host branch here

Inputs

Required

Name Description Type Default Required
ssh_public_key SSH Public Key. string n/a yes

Optional

Name Description Type Default Required
server Server configuration map. map(any) {name = "docker-host", server_type = "cx11", image = "ubuntu-20.04", location = "nbg1", backups = false} no
docker_compose_version Docker compose version to install. string "2.17.3" no
volume_size Volume size (GB) (min 10, max 10240). number 10 no
volume_filesystem Volume filesystem. string "xfs" no
ssh_public_key_name SSH Public Key Name. string "default" no

Outputs

Name Description
ipv4_address IPv4 address of server.
volume_size Size of dedicated Docker data root volume.
volume_mount_point Mount point of dedicated Docker volume.

Requirements

These sections describe requirements for using this module.

Software

The following dependencies must be available:

Hetzner Cloud Account

A Hetzner Cloud account and API Token (with Read & Write permissions) to provision the resources of this module.

terraform-hcloud-docker-host's People

Contributors

colinwilson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.