项目作者: colinwilson

项目描述 :
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.
高级语言: HCL
项目地址: git://github.com/colinwilson/terraform-hcloud-docker-host.git
创建时间: 2020-11-25T23:33:33Z
项目社区:https://github.com/colinwilson/terraform-hcloud-docker-host

开源协议:Apache License 2.0

下载


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:

  1. module "hcloud-docker-host" {
  2. source = "github.com/colinwilson/terraform-hcloud-docker-host"
  3. version = "~> 0.1.4"
  4. server = {
  5. name = "docker-swarm-host-01"
  6. server_type = "cx11"
  7. image = "ubuntu-20.04"
  8. location = "hel1"
  9. backups = false
  10. }
  11. ssh_public_key_name = "my_ssh_key"
  12. ssh_public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJNcwP5mhs5/F2T9GFHmg4z6E6sbOG+Ynx2iPERKeOGm"
  13. volume_size = 20
  14. volume_filesystem = "xfs"
  15. }

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.