All Projects → hobby-kube → Provisioning

hobby-kube / Provisioning

Licence: mit
Kubernetes cluster provisioning using Terraform.

Projects that are alternatives of or similar to Provisioning

Guide
Kubernetes clusters for the hobbyist.
Stars: ✭ 5,150 (+1759.21%)
Mutual labels:  automation, terraform, setup, guide
Terraform
Terraform automation for Cloud
Stars: ✭ 121 (-56.32%)
Mutual labels:  automation, terraform, hcl
Ebs bckup
Stars: ✭ 32 (-88.45%)
Mutual labels:  automation, terraform, hcl
Terraform
Terraform - Beginners | Intermediate | Advanced
Stars: ✭ 77 (-72.2%)
Mutual labels:  automation, terraform, hcl
Terraform Aws Spotgpu
Fully automated provisioning of AWS EC2 Spot Instances for Deep Learning workloads using Terraform.
Stars: ✭ 127 (-54.15%)
Mutual labels:  automation, terraform, hcl
Infra Personal
Terraform for setting up my personal infrastructure
Stars: ✭ 45 (-83.75%)
Mutual labels:  automation, terraform, hcl
Terraform Modules
Terraform Modules
Stars: ✭ 25 (-90.97%)
Mutual labels:  terraform, hcl, provisioning
Terraform Import Github Organization
Script to fully automate Terraform import of Github Org (teams, users, and repos)
Stars: ✭ 95 (-65.7%)
Mutual labels:  automation, terraform
Tensor
Tensor - Comprehensive web-based automation framework and Centralized infrastructure management platform
Stars: ✭ 136 (-50.9%)
Mutual labels:  automation, terraform
Mac Setup
🛠️ Front end web development setup for macOS.
Stars: ✭ 265 (-4.33%)
Mutual labels:  setup, guide
Terrahub
Terraform Automation and Orchestration Tool (Open Source)
Stars: ✭ 148 (-46.57%)
Mutual labels:  automation, terraform
Provision
Digital Rebar Provision is a simple and powerful Golang executable that provides a complete API-driven DHCP/PXE/TFTP provisioning system.
Stars: ✭ 252 (-9.03%)
Mutual labels:  automation, provisioning
Terraform Provider Aiven
Terraform Aiven provider
Stars: ✭ 68 (-75.45%)
Mutual labels:  automation, terraform
Electriceye
Continuously monitor your AWS services for configurations that can lead to degradation of confidentiality, integrity or availability. All results will be sent to Security Hub for further aggregation and analysis.
Stars: ✭ 255 (-7.94%)
Mutual labels:  automation, terraform
Charles-Proxy-Mobile-Guide
The mobile hackers' guide to Charles Proxy 👍
Stars: ✭ 105 (-62.09%)
Mutual labels:  setup, guide
Terraform Aws Eks Cluster
Terraform module for provisioning an EKS cluster
Stars: ✭ 256 (-7.58%)
Mutual labels:  terraform, hcl
Terrible
An Ansible playbook that apply the principle of the Infrastructure as Code on a QEMU/KVM environment.
Stars: ✭ 161 (-41.88%)
Mutual labels:  automation, terraform
Terraform Examples
Terraform samples for all the major clouds you can copy and paste. The future, co-created.
Stars: ✭ 256 (-7.58%)
Mutual labels:  terraform, hcl
Pre Commit Terraform
pre-commit git hooks to take care of Terraform configurations
Stars: ✭ 902 (+225.63%)
Mutual labels:  automation, terraform
dvc dask use case
A use case of a reproducible machine learning pipeline using Dask, DVC, and MLflow.
Stars: ✭ 22 (-92.06%)
Mutual labels:  setup, guide

Kubernetes cluster setup automation

This is part of the Hobby Kube project. Functionality of the modules is described in the guide.

Deploy a secure Kubernetes cluster on Hetzner Cloud, Scaleway, DigitalOcean or Packet using Terraform.

Setup

Requirements

The following packages are required to be installed locally:

brew install terraform kubectl jq wireguard-tools

Modules are using ssh-agent for remote operations. Add your SSH key with ssh-add -K if Terraform repeatedly fails to connect to remote hosts.

Configuration

Important: Modify only main.tf in project root, comment or uncomment sections as needed. All variables in variables.tf can be set either directly or from environment variable.

Export the following environment variables depending on the modules you're using:

Set number of hosts (nodes)

export TF_VAR_node_count=3

Set number of etcd members

The first N nodes will be part of the etcd cluster. 3 or 5 are good values, see here.

export TF_VAR_etcd_node_count=3

Using Hetzner Cloud as provider

export TF_VAR_hcloud_token=<token>
export TF_VAR_hcloud_ssh_keys=<keys>
export TF_VAR_hcloud_ssh_keys='["<description-key1>", "<description-key2>"]'
# Defaults:
# export TF_VAR_hcloud_location="nbg1"
# export TF_VAR_hcloud_type="cx11"
# export TF_VAR_hcloud_image="ubuntu-20.04"

SSH keys are referenced by their description. Visit the Hetzner Cloud console at https://console.hetzner.cloud/projects/<project-id>/access/sshkeys

Using Scaleway as provider

export TF_VAR_scaleway_organization_id=<organization_id>
export TF_VAR_scaleway_access_key=<access_key> # can be omitted for now
export TF_VAR_scaleway_secret_key=<secret_key>
# Defaults:
# export TF_VAR_scaleway_zone="nl-ams-1"
# export TF_VAR_scaleway_type="DEV1-S"
# export TF_VAR_scaleway_image="Ubuntu 20.04 Focal Fossa"

Using DigitalOcean as provider

export TF_VAR_digitalocean_token=<token>
export TF_VAR_digitalocean_ssh_keys=<keys>
export TF_VAR_digitalocean_ssh_keys='["<id-key1>", "<id-key2>"]'
# Defaults:
# export TF_VAR_digitalocean_region="fra1"
# export TF_VAR_digitalocean_size="1gb"
# export TF_VAR_digitalocean_image="ubuntu-20-04-x64"

You can get SSH key IDs using this API.

Using Packet as provider

export TF_VAR_packet_auth_token=<token>
export TF_VAR_packet_project_id=<uuid>
# Defaults:
# export TF_VAR_packet_facility="sjc1"
# export TF_VAR_packet_plan="c1.small.x86"
# export TF_VAR_packet_operating_system="ubuntu_20_04"

Using vSphere as provider

export TF_VAR_vsphere_server=<FQDN or IP of vCenter Server>
export TF_VAR_vsphere_datacenter=<vSphere Datacenter Name>
export TF_VAR_vsphere_cluster=<vSphere Cluster Name>
export TF_VAR_vsphere_network=<vSphere Network Name>
export TF_VAR_vsphere_datastore=<vSphere Datastore Name>
export TF_VAR_vsphere_vm_template=<vSphere VM Template Name>
export TF_VAR_vsphere_user=<vSphere Admin Username>
export TF_VAR_vsphere_password=<vSphere Admin Password>
# Defaults:
# export TF_VAR_vsphere_vm_linked_clone=false
# export TF_VAR_vsphere_vm_num_cpus="2"
# export TF_VAR_vsphere_vm_memory="2048"

Template VM needs to pre-configured so that root can login using SSH key.

Using Cloudflare for DNS entries

export TF_VAR_domain=<domain> # e.g. example.org
export TF_VAR_cloudflare_email=<email>
export TF_VAR_cloudflare_api_token=<token>

Using Amazon Route 53 for DNS entries

export TF_VAR_domain=<domain> # e.g. example.org shall be already added to hosted zones.
export TF_VAR_aws_access_key=<ACCESS_KEY>
export TF_VAR_aws_secret_key=<SECRET_KEY>
export TF_VAR_aws_region=<region> # e.g. eu-west-1

Install additional APT packages

Each provider takes an optional variable to install further packages during provisioning:

module "provider" {
  # ...
  apt_packages = ["ceph-common", "nfs-common"]
}

Add more firewall rules

Security/ufw takes an optional variable to add custom firewall rules during provisioning:

module "firewall" {
  # ...
  additional_rules = ["allow 1194/udp", "allow ftp"]
}

Execute

From the root of this project...

# fetch the required modules
$ terraform init

# see what `terraform apply` will do
$ terraform plan

# execute it
$ terraform apply

Using modules independently

Modules in this repository can be used independently:

module "kubernetes" {
  source = "github.com/hobby-kube/provisioning/service/kubernetes"
}

After adding this to your plan, run terraform get to fetch the module.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].