Skip to content

Commit

Permalink
Use LB dns name instead of the LB ip. Addes nginx ingress controller …
Browse files Browse the repository at this point in the history
…support
  • Loading branch information
garutilorenzo committed Feb 25, 2022
1 parent ddac266 commit a3aac49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ data "template_cloudinit_config" "k3s_server_tpl" {

part {
content_type = "text/x-shellscript"
content = templatefile("${path.module}/files/k3s-install-server.sh", { k3s_token = var.k3s_token, is_k3s_server = true, compartment_ocid = var.compartment_ocid, availability_domain = var.availability_domain, k3s_url = oci_network_load_balancer_network_load_balancer.k3s_load_balancer.ip_addresses[0].ip_address, k3s_tls_san = oci_network_load_balancer_network_load_balancer.k3s_load_balancer.ip_addresses[0].ip_address, install_longhorn = var.install_longhorn, longhorn_release = var.longhorn_release })
content = templatefile("${path.module}/files/k3s-install-server.sh", { k3s_token = var.k3s_token, is_k3s_server = true, install_nginx_ingress = var.install_nginx_ingress, compartment_ocid = var.compartment_ocid, availability_domain = var.availability_domain, k3s_url = local.k3s_int_lb_dns_name, k3s_tls_san = local.k3s_int_lb_dns_name, install_longhorn = var.install_longhorn, longhorn_release = var.longhorn_release })
}
}

Expand All @@ -14,7 +14,7 @@ data "template_cloudinit_config" "k3s_worker_tpl" {

part {
content_type = "text/x-shellscript"
content = templatefile("${path.module}/files/k3s-install-agent.sh", { k3s_token = var.k3s_token, is_k3s_server = false, k3s_url = oci_network_load_balancer_network_load_balancer.k3s_load_balancer.ip_addresses[0].ip_address })
content = templatefile("${path.module}/files/k3s-install-agent.sh", { k3s_token = var.k3s_token, is_k3s_server = false, k3s_url = local.k3s_int_lb_dns_name })
}
}

Expand Down
3 changes: 3 additions & 0 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
locals {
k3s_int_lb_dns_name = format("%s.%s.%s.oraclevcn.com", replace(var.k3s_load_balancer_name, " ", "-"), var.oci_core_subnet_dns_label11, var.oci_core_vcn_dns_label)
}

0 comments on commit a3aac49

Please sign in to comment.