Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kerwanp/hetzner-k8s-terraform-module
Create Kubernetes Clusters on Hetzner Cloud with ease
https://github.com/kerwanp/hetzner-k8s-terraform-module
Last synced: 11 days ago
JSON representation
Create Kubernetes Clusters on Hetzner Cloud with ease
- Host: GitHub
- URL: https://github.com/kerwanp/hetzner-k8s-terraform-module
- Owner: kerwanp
- Created: 2024-08-20T13:33:32.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-20T16:44:42.000Z (3 months ago)
- Last Synced: 2024-08-21T15:37:37.653Z (3 months ago)
- Language: HCL
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hetzner Kubernetes Terraform Module
This Terraform module allows you to bootstrap self-managed clusters on Hetzner Cloud in no time. Perfect for labs.
> ⚠ This is not battle tested, use it are your own risks.
## Features
- ✅ Cheap nodes thanks to [Hetzner Cloud](https://www.hetzner.com/) pricing
- ✅ Automatically creates and joins new nodes
- ✅ Manages Persistent volume claims by using Hetzner [Cloud Storage Interface driver](https://github.com/hetznercloud/csi-driver)
- ✅ Manages Load balancer by using Hetzner [Cloud Controller Manager](https://github.com/hetznercloud/hcloud-cloud-controller-manager)## Example
```hcl
provider "hcloud" {
token = var.hcloud_token
}resource "hcloud_ssh_key" "personal" {
name = "Personal"
public_key = file("~/.ssh/id_ed25519.pub")
}module "cluster" {
source = "../"name = "my-cluster"
ssh_key = hcloud_ssh_key.personal.idhcloud_token = var.hcloud_token
cidr = "10.0.0.0/16"
zone = "nbg1"master = {
server_type = "cpx21"
}agents = {
0 = {
server_type = "cpx21"
}
}
}resource "local_sensitive_file" "kubeconfig" {
content = module.cluster.kubeconfig.content
filename = "kubeconfig.yaml"
}
```## Inputs
| Name | Description | Type | Default | Required |
| --------------------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | ------- | :------: |
| [agents](#input_agents) | Map of agents configurations |map(object({| `{}` | no |
server_type = string
}))
| [ccm](#input_ccm) | Hetzner Cloud Controller Manager configuration | `any` | `null` | no |
| [cidr](#input_cidr) | IP addresses range for the private network | `string` | n/a | yes |
| [csi](#input_csi) | Hetzner Container Storage Interface configuration | `any` | `null` | no |
| [flannel](#input_flannel) | Flannel configuration | `any` | `null` | no |
| [hcloud_token](#input_hcloud_token) | The Hetzner Cloud API token | `string` | n/a | yes |
| [master](#input_master) | Master configuration |object({| n/a | yes |
server_type = string
})
| [name](#input_name) | The name of the cluster used to prefix resources | `string` | n/a | yes |
| [ssh_key](#input_ssh_key) | SSH Key ID or name that will be added to created servers | `string` | n/a | yes |
| [zone](#input_zone) | Zone where resources will be created | `string` | n/a | yes |## Outputs
| Name | Description |
| ----------------------------------------------------------------- | ----------- |
| [kubeconfig](#output_kubeconfig) | n/a |