Move infra-setup and k3s-setup into dedicated directories

This changes makes it easier to differentiate and understand the
different parts of the kubernetes setup. On one hand we have the bare
infrastructure (servers, network, etc), on the other hand we have the
software (k3s in this case).

In the future we'll have a few more parts, like the minimal
configuration of the kubernetes cluster, e.g. with a cert-manager. This
is easier to manage with helm or terraform than with ansible. Therefore
it makes even more sense to split the responsibilities into dedicated
directories.
This commit is contained in:
2025-09-15 12:45:50 +02:00
parent dfcdc9797a
commit d96523a071
24 changed files with 89 additions and 59 deletions

74
infra/variables.tf Normal file
View File

@@ -0,0 +1,74 @@
variable "expose_kubernetes_and_ssh_ports" {
type = bool
default = false
}
variable "hetzner_dns_apitoken" {
type = string
}
variable "hetzner_cloud_apitoken" {
type = string
}
variable "nehrke_info_dkim" {
type = string
sensitive = true
}
variable "sozpaedil_net_dkim" {
type = string
sensitive = true
}
variable "ssh_keys" {
type = map(string)
}
variable "k8s_test_installation" {
default = false
description = <<EOF
When this is set to true we configure primary-ips to not be deleted automatically!
This allows us to reuse the same IP for multiple create/destroy cycles.
As soon as the test-phase is over this should be false.
EOF
}
# Right now this only supports 1 location, but that's okay for me!
variable "k8s_location" {
type = string
description = <<EOF
This is the location where I host the k8s-cluster.
An overview of possible locations can be found at: https://docs.hetzner.com/cloud/general/locations/
EOF
}
variable "k8s_ip_datacenter" {
type = string
description = <<EOF
This is the datacenter where the public IPs of the k8s-cluster belong to.
An overview of possible locations can be found at: https://docs.hetzner.com/cloud/general/locations/
Note, that the k8s_ip_datacenter has to match the k8s_location!
EOF
}
variable "k8s_server_count" {
type = number
default = 3
description = "Number of k8s-server nodes. This should always be an odd number."
}
variable "k8s_server_type" {
type = string
default = "cax11"
}
variable "k8s_agent_count" {
type = number
default = 3
}
variable "k8s_agent_type" {
type = string
default = "cax11"
}