-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
138 lines (117 loc) · 3.38 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
variable "hcloud_token" {
type = string
sensitive = true
description = "Hetzner Cloud API token"
}
variable "labels" {
type = map(string)
description = "Labels to apply to all resources"
default = {
environment = "production"
}
}
variable "environment" {
description = "The name to use for all the cluster resources"
type = string
}
variable "cluster_name" {
description = "The name to use for all the cluster resources"
type = string
}
variable "cluster_server_os" {
description = "The OS to use for the cluster servers"
type = string
default = "ubuntu-24.04"
}
variable "cluster_master_node_type" {
description = "The server type to use for the master node"
type = string
default = "cax11"
}
variable "cluster_location" {
description = "The location to use for the cluster"
type = string
default = "hel1"
validation {
condition = can(regex("^[a-z0-9]+$", var.cluster_location))
error_message = "The cluster location must be lowercase."
}
}
variable "cluster_worker_node_count" {
description = "The number of worker nodes to create"
type = number
default = 1
validation {
condition = var.cluster_worker_node_count >= 0
error_message = "The number of worker nodes must be greater than or equal to 0."
}
}
variable "cluster_worker_node_type" {
description = "The server type to use for the worker nodes"
type = string
default = "cax11"
}
variable "ssh_port" {
description = "The main SSH port to connect to the nodes."
type = number
default = 22
validation {
condition = var.ssh_port >= 0 && var.ssh_port <= 65535
error_message = "The SSH port must use a valid range from 0 to 65535."
}
}
variable "ssh_user" {
description = "The SSH user to connect to the nodes."
type = string
default = "root"
}
variable "firewall_ids" {
description = "List of firewall IDs to attach to the nodes."
type = list(string)
default = []
}
variable "cluster_private_network_name" {
description = "The name to use for the private network."
type = string
default = "kubernetes-cluster"
}
variable "cluster_private_network_ip_range" {
description = "The IP range to use for the private network."
type = string
default = "10.0.0.0/16"
}
variable "cluster_private_network_subnet_ip_range" {
description = "The IP range to use for the private network."
type = string
default = "10.0.1.0/24"
}
variable "cluster_private_network_subnet_zone" {
description = "The IP range to use for the private network."
type = string
default = "eu-central"
}
variable "cluster_master_node_private_ip" {
description = "The private IP address of the master node."
type = string
default = "10.0.1.1"
}
variable "k3s_file_path" {
description = "The path to the k3s.yaml file."
type = string
default = "/etc/rancher/k3s/k3s.yaml"
}
variable "generated_ssh_key_name" {
type = string
default = "terraform-key-pair"
description = "Key-pair generated by Terraform"
}
variable "ssh_key_algorithm" {
description = "The SSH key algorithm to use."
type = string
default = "RSA"
}
variable "cluster_firewall_name" {
description = "The name to use for the firewall."
type = string
default = "k3s-firewall"
}