Added kubernetes cluster

This commit is contained in:
2022-06-04 14:07:06 +02:00
parent 5be8d177ae
commit e48fef19cd
5 changed files with 962 additions and 5634 deletions

52
main.tf
View File

@@ -1,10 +1,28 @@
terraform {
required_version = ">= 1.2.0"
required_providers {
hcloud = {
source = "hetznercloud/hcloud"
version = ">= 1.0.0"
}
}
}
provider "hcloud" {
token = var.hcloud_token
}
module "kube-hetzner" {
providers = {
hcloud = hcloud
}
source = "kube-hetzner/kube-hetzner/hcloud"
hcloud_token = var.hcloud_token
public_key = ".keys/id_ed25519.pub"
private_key = ".keys/id_ed25519"
ssh_public_key = file(".keys/id_ed25519.pub")
ssh_private_key = file(".keys/id_ed25519")
network_region = "eu-central" # change to `us-east` if location is ash
control_plane_nodepools = [
@@ -49,7 +67,7 @@ module "kube-hetzner" {
location = "nbg1",
labels = [],
taints = [],
count = 1
count = 0
},
{
name = "storage1",
@@ -61,13 +79,14 @@ module "kube-hetzner" {
taints = [
"server-usage=storage:NoSchedule"
],
count = 2
count = 1
}
]
load_balancer_type = "lb11"
load_balancer_location = "fsn1"
traefik_enabled = true
traefik_additional_options = ["--log.level=DEBUG", "--tracing=true"]
metrics_server_enabled = true
automatically_upgrade_k3s = true
initial_k3s_channel = "stable"
@@ -95,10 +114,7 @@ module "kube-hetzner" {
}
]
# If you want to configure additional Arguments for traefik, enter them here as a list and in the form of traefik CLI arguments; see https://doc.traefik.io/traefik/reference/static-configuration/cli/
# Example: traefik_additional_options = ["--log.level=DEBUG", "--tracing=true"]
traefik_additional_options = ["--tracing=true"]
enable_cert_manager = true
enable_cert_manager = false
}
module "dns" {
@@ -121,13 +137,13 @@ module "dns" {
]
}
module "flux" {
source = "./modules/flux"
path = "clank"
namespace = "flux-system"
url = "ssh://git@git.front.kjuulh.io/clank/kubernetes-state.git"
branch = "main"
ssh_private_key_pem = file(".keys/id_clank")
ssh_public_key_pem = file(".keys/id_clank.pub")
}
#module "flux" {
# source = "./modules/flux"
# path = "clank"
# namespace = "flux-system"
# url = "ssh://git@git.front.kjuulh.io/clank/kubernetes-state.git"
# branch = "main"
#
# ssh_private_key_pem = file(".keys/id_clank")
# ssh_public_key_pem = file(".keys/id_clank.pub")
#}