mirror of
https://github.com/apricote/home-cloud.git
synced 2026-02-07 02:07:02 +00:00
feat: install new k3s cluster
This commit is contained in:
parent
7d25467fb4
commit
41d120b277
11 changed files with 418 additions and 36 deletions
22
k3s_cluster_v2/agents.tf
Normal file
22
k3s_cluster_v2/agents.tf
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
resource "hcloud_server" "agents" {
|
||||
count = var.compute_count
|
||||
name = "k3s-agent-${count.index}"
|
||||
|
||||
image = data.hcloud_image.ubuntu.name
|
||||
server_type = var.compute_server_type
|
||||
location = var.server_location
|
||||
|
||||
ssh_keys = [data.hcloud_ssh_key.default.id]
|
||||
labels = {
|
||||
provisioner = "terraform",
|
||||
engine = "k3s",
|
||||
node_type = "agent",
|
||||
}
|
||||
}
|
||||
|
||||
resource "hcloud_server_network" "agents_network" {
|
||||
count = length(hcloud_server.agents)
|
||||
server_id = hcloud_server.agents[count.index].id
|
||||
subnet_id = hcloud_network_subnet.k3s_nodes.id
|
||||
ip = cidrhost(hcloud_network_subnet.k3s_nodes.ip_range, 1 + var.control_count + count.index)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue