Merge branch 'master' into feat/calico
This commit is contained in:
19
init.tf
19
init.tf
@@ -3,13 +3,13 @@ resource "null_resource" "first_control_plane" {
|
||||
user = "root"
|
||||
private_key = local.ssh_private_key
|
||||
agent_identity = local.ssh_identity
|
||||
host = module.control_planes[0].ipv4_address
|
||||
host = module.control_planes[keys(module.control_planes)[0]].ipv4_address
|
||||
}
|
||||
|
||||
# Generating k3s master config file
|
||||
provisioner "file" {
|
||||
content = yamlencode(merge({
|
||||
node-name = module.control_planes[0].name
|
||||
node-name = module.control_planes[keys(module.control_planes)[0]].name
|
||||
token = random_password.k3s_token.result
|
||||
cluster-init = true
|
||||
disable-cloud-controller = true
|
||||
@@ -17,15 +17,16 @@ resource "null_resource" "first_control_plane" {
|
||||
flannel-iface = "eth1"
|
||||
kubelet-arg = ["cloud-provider=external", "volume-plugin-dir=/var/lib/kubelet/volumeplugins"]
|
||||
kube-controller-manager-arg = "flex-volume-plugin-dir=/var/lib/kubelet/volumeplugins"
|
||||
node-ip = module.control_planes[0].private_ipv4_address
|
||||
advertise-address = module.control_planes[0].private_ipv4_address
|
||||
node-taint = var.allow_scheduling_on_control_plane ? [] : ["node-role.kubernetes.io/master:NoSchedule"]
|
||||
node-label = var.automatically_upgrade_k3s ? ["k3s_upgrade=true"] : []
|
||||
node-ip = module.control_planes[keys(module.control_planes)[0]].private_ipv4_address
|
||||
advertise-address = module.control_planes[keys(module.control_planes)[0]].private_ipv4_address
|
||||
node-taint = local.control_plane_nodepools[keys(module.control_planes)[0]].taints
|
||||
node-label = local.control_plane_nodepools[keys(module.control_planes)[0]].labels
|
||||
disable-network-policy = var.cni_plugin == "calico" ? true : var.disable_network_policy
|
||||
},
|
||||
var.cni_plugin == "calico" ? {
|
||||
flannel-backend = "none"
|
||||
} : {}))
|
||||
|
||||
destination = "/tmp/config.yaml"
|
||||
}
|
||||
|
||||
@@ -62,7 +63,7 @@ resource "null_resource" "first_control_plane" {
|
||||
}
|
||||
|
||||
depends_on = [
|
||||
hcloud_network_subnet.subnet["control_plane"]
|
||||
hcloud_network_subnet.control_plane
|
||||
]
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ resource "null_resource" "kustomization" {
|
||||
user = "root"
|
||||
private_key = local.ssh_private_key
|
||||
agent_identity = local.ssh_identity
|
||||
host = module.control_planes[0].ipv4_address
|
||||
host = module.control_planes[keys(module.control_planes)[0]].ipv4_address
|
||||
}
|
||||
|
||||
# Upload kustomization.yaml, containing Hetzner CSI & CSM, as well as kured.
|
||||
@@ -103,7 +104,7 @@ resource "null_resource" "kustomization" {
|
||||
name = "${var.cluster_name}-traefik"
|
||||
load_balancer_disable_ipv6 = var.load_balancer_disable_ipv6
|
||||
load_balancer_type = var.load_balancer_type
|
||||
location = var.location
|
||||
location = var.load_balancer_location
|
||||
traefik_acme_tls = var.traefik_acme_tls
|
||||
traefik_acme_email = var.traefik_acme_email
|
||||
traefik_additional_options = var.traefik_additional_options
|
||||
|
Reference in New Issue
Block a user