Agents IP should not depend on servers_num
This commit is contained in:
parent
43de74b887
commit
0b13f900e1
@ -82,7 +82,7 @@ resource "hcloud_server" "agents" {
|
|||||||
node-name = self.name
|
node-name = self.name
|
||||||
kubelet-arg = "cloud-provider=external"
|
kubelet-arg = "cloud-provider=external"
|
||||||
flannel-iface = "eth1"
|
flannel-iface = "eth1"
|
||||||
node-ip = cidrhost(hcloud_network.k3s.ip_range, 2 + var.servers_num + count.index)
|
node-ip = cidrhost(hcloud_network_subnet.k3s.ip_range, 257 + count.index)
|
||||||
})
|
})
|
||||||
destination = "/etc/rancher/k3s/config.yaml"
|
destination = "/etc/rancher/k3s/config.yaml"
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ resource "hcloud_server" "agents" {
|
|||||||
|
|
||||||
network {
|
network {
|
||||||
network_id = hcloud_network.k3s.id
|
network_id = hcloud_network.k3s.id
|
||||||
ip = cidrhost(hcloud_network.k3s.ip_range, 2 + var.servers_num + count.index)
|
ip = cidrhost(hcloud_network_subnet.k3s.ip_range, 257 + count.index)
|
||||||
}
|
}
|
||||||
|
|
||||||
depends_on = [
|
depends_on = [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
locals {
|
locals {
|
||||||
first_control_plane_network_ip = cidrhost(hcloud_network.k3s.ip_range, 2)
|
first_control_plane_network_ip = cidrhost(hcloud_network_subnet.k3s.ip_range, 2)
|
||||||
hcloud_image_name = "ubuntu-20.04"
|
hcloud_image_name = "ubuntu-20.04"
|
||||||
ssh_public_key = trimspace(file(var.public_key))
|
ssh_public_key = trimspace(file(var.public_key))
|
||||||
# ssh_private_key is either the contents of var.private_key or null to use a ssh agent.
|
# ssh_private_key is either the contents of var.private_key or null to use a ssh agent.
|
||||||
|
@ -68,9 +68,9 @@ resource "hcloud_server" "control_planes" {
|
|||||||
disable = "servicelb, local-storage"
|
disable = "servicelb, local-storage"
|
||||||
flannel-iface = "eth1"
|
flannel-iface = "eth1"
|
||||||
kubelet-arg = "cloud-provider=external"
|
kubelet-arg = "cloud-provider=external"
|
||||||
node-ip = cidrhost(hcloud_network.k3s.ip_range, 3 + count.index)
|
node-ip = cidrhost(hcloud_network_subnet.k3s.ip_range, 3 + count.index)
|
||||||
advertise-address = cidrhost(hcloud_network.k3s.ip_range, 3 + count.index)
|
advertise-address = cidrhost(hcloud_network_subnet.k3s.ip_range, 3 + count.index)
|
||||||
tls-san = cidrhost(hcloud_network.k3s.ip_range, 3 + count.index)
|
tls-san = cidrhost(hcloud_network_subnet.k3s.ip_range, 3 + count.index)
|
||||||
token = random_password.k3s_token.result
|
token = random_password.k3s_token.result
|
||||||
node-taint = var.allow_scheduling_on_control_plane ? [] : ["node-role.kubernetes.io/master:NoSchedule"]
|
node-taint = var.allow_scheduling_on_control_plane ? [] : ["node-role.kubernetes.io/master:NoSchedule"]
|
||||||
})
|
})
|
||||||
@ -104,7 +104,7 @@ resource "hcloud_server" "control_planes" {
|
|||||||
|
|
||||||
network {
|
network {
|
||||||
network_id = hcloud_network.k3s.id
|
network_id = hcloud_network.k3s.id
|
||||||
ip = cidrhost(hcloud_network.k3s.ip_range, 3 + count.index)
|
ip = cidrhost(hcloud_network_subnet.k3s.ip_range, 3 + count.index)
|
||||||
}
|
}
|
||||||
|
|
||||||
depends_on = [
|
depends_on = [
|
||||||
|
Loading…
Reference in New Issue
Block a user