add flatcar to hetzner

This commit is contained in:
Florian Nowarre 2022-09-18 23:32:06 +02:00
parent ab03825875
commit f406e30191
3 changed files with 12 additions and 9 deletions

View file

@ -59,8 +59,8 @@ Edit `default.tfvars` to match your requirement.
Run Terraform to create the infrastructure. Run Terraform to create the infrastructure.
```bash ```bash
terraform -chdir=../../contrib/terraform/hetzner init terraform -chdir=./kubespray/contrib/terraform/hetzner/ init
terraform -chdir=../../contrib/terraform/hetzner/ apply --var-file=default.tfvars terraform -chdir=./kubespray/contrib/terraform/hetzner/ apply --var-file=./kubespray/inventory/my-hetzner-cluster/default.tfvars
``` ```
You should now have a inventory file named `inventory.ini` that you can use with kubespray. You should now have a inventory file named `inventory.ini` that you can use with kubespray.
@ -75,7 +75,7 @@ ansible -i inventory.ini -m ping all
You can setup Kubernetes with kubespray using the generated inventory: You can setup Kubernetes with kubespray using the generated inventory:
```bash ```bash
ansible-playbook -i inventory.ini ../../cluster.yml -b -v ansible-playbook -i inventory.ini ./kubespray/cluster.yml -b -v
``` ```
## Cloud controller ## Cloud controller

View file

@ -1,7 +1,8 @@
provider "hcloud" {} provider "hcloud" {}
module "kubernetes" { module "kubernetes" {
source = "./modules/kubernetes-cluster-flatcar" source = "./modules/kubernetes-cluster"
#source = "./modules/kubernetes-cluster-flatcar"
prefix = var.prefix prefix = var.prefix
@ -9,7 +10,9 @@ module "kubernetes" {
machines = var.machines machines = var.machines
ssh_private_key_path = var.ssh_private_key_path #only for flatcar
#ssh_private_key_path = var.ssh_private_key_path
ssh_public_keys = var.ssh_public_keys ssh_public_keys = var.ssh_public_keys
network_zone = var.network_zone network_zone = var.network_zone
@ -50,4 +53,4 @@ resource "null_resource" "inventories" {
triggers = { triggers = {
template = data.template_file.inventory.rendered template = data.template_file.inventory.rendered
} }
} }

View file

@ -7,9 +7,9 @@ terraform {
null = { null = {
source = "hashicorp/null" source = "hashicorp/null"
} }
#template = { template = {
# source = "hashicorp/template" source = "hashicorp/template"
#} }
} }
required_version = ">= 0.14" required_version = ">= 0.14"
} }