Skip to content
Snippets Groups Projects
Verified Commit bde522b5 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

terraform: Add a way to deploy worker nodes

parent 1e764a54
No related branches found
No related tags found
No related merge requests found
...@@ -24,3 +24,22 @@ module "nodes" { ...@@ -24,3 +24,22 @@ module "nodes" {
# subnet = hcloud_network_subnet.subnet.id # subnet = hcloud_network_subnet.subnet.id
user_data = file("templates/cloud-init.tpl") user_data = file("templates/cloud-init.tpl")
} }
module "workers" {
source = "./modules/hcloud_instance"
instance_count = var.replicas_worker
location = var.location
name = "worker"
dns_domain = var.dns_domain
dns_zone_id = var.dns_zone_id
image = var.image
labels = {
"k8s.io/node" = "true",
"k8s.io/worker" = "true"
}
placement_group_id = hcloud_placement_group.k8s.id
ssh_keys = data.hcloud_ssh_keys.all_keys.ssh_keys.*.name
server_type = "cx21"
# subnet = hcloud_network_subnet.subnet.id
user_data = file("templates/cloud-init.tpl")
}
...@@ -4,10 +4,10 @@ variable "replicas_nodes" { ...@@ -4,10 +4,10 @@ variable "replicas_nodes" {
description = "Count of nodes" description = "Count of nodes"
} }
variable "bootstrap" { variable "replicas_worker" {
type = bool type = number
default = false default = 0
description = "Whether to deploy a bootstrap instance" description = "Count of nodes"
} }
variable "dns_domain" { variable "dns_domain" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment