Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

A simple module to provision servers in Hetzner Cloud for use with Rancher/Kubernetes

Notifications You must be signed in to change notification settings

identinet/terraform-hcloud

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

terraform-hcloud

A simple and opinionated module to create servers in Hetzner Cloud and - by default - to provision the servers with Ansible first and then install Kubernetes with Rancher, but both of these are optional. See the variables file for the available configuration settings.

Usage

Add the provider to your main.tf:

terraform {
  required_providers {
    hcloud = {
      source  = "hetznercloud/hcloud"
      version = "~> 1.23.0"
    }
  }
}

provider "hcloud" {
  token = var.hcloud_token
}

Example config:

cluster_name    = ...
ssh_private_key = "~/.ssh/id_rsa"
ssh_public_key  = "~/.ssh/id_rsa.pub"

install_ansible_dependencies = true
ansible_playbook_path       = ...
ansible_vault_password_path = ...

run_rancher_deploy = true

servers = {
  1 = {
    name               = "master"
    private_ip_address = "10.0.0.2"
    server_type        = "cx41"
    image              = "centos-7"
    location           = "nbg1"
    backups            = true
    roles              = "--etcd --controlplane" # to deploy Kubernetes with Rancher
    user_data_file     = "cloud-init.conf"
  },

  2 = {
    name               = "worker"
    private_ip_address = "10.0.0.3"
    server_type        = "cx41"
    image              = "centos-7"
    location           = "nbg1"
    backups            = true
    roles              = "--worker" # to deploy Kubernetes with Rancher
    user_data_file     = "cloud-init.conf"
  },

  ...
}

Development

About

A simple module to provision servers in Hetzner Cloud for use with Rancher/Kubernetes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 100.0%