diff --git a/terraform/modules/argocd/argocd.tf b/terraform/modules/argocd/argocd.tf index d2dcb3fa14bc7e6bfacc14a2f6019d2e265bb138..3c6496a2b284f6ad8d027567d383f16dcee23359 100644 --- a/terraform/modules/argocd/argocd.tf +++ b/terraform/modules/argocd/argocd.tf @@ -1,6 +1,5 @@ locals { cluster_argocd_url = var.argocd_master ? "https://kubernetes.default.svc" : "${var.rancher_url}/k8s/clusters/${var.cluster_kube_id}" - #nfs_path = var.nfs_path == "" ? "/radiant/projects/${var.os_project_name}/${var.cluster_name}" : var.nfs_path nfs_path = var.nfs_path == "" ? "/radiant/projects/${var.openstack_project}" : var.nfs_path argocd_cluster = templatefile("${path.module}/templates/cluster.yaml.tmpl", { diff --git a/terraform/modules/argocd/templates/argocd.yaml.tmpl b/terraform/modules/argocd/templates/argocd.yaml.tmpl index 7abb0d766bfe6216f5577cbf5465c562bb886ecb..657df668a258d1d5aef497d11104253ad356523c 100644 --- a/terraform/modules/argocd/templates/argocd.yaml.tmpl +++ b/terraform/modules/argocd/templates/argocd.yaml.tmpl @@ -89,7 +89,7 @@ spec: enabled: ${nfs_enabled} server: ${nfs_server} path: ${nfs_path} - pathPattern: "${cluster_name}/$${.PVC.namespace}/$${.PVC.name}" + pathPattern: "${cluster_name}/$${.PVC.namespace}-$${.PVC.name}-$${.PV.name}" cinder: enabled: ${cinder_enabled} diff --git a/terraform/modules/compute/openstack/network.tf b/terraform/modules/compute/openstack/network.tf index 830267096d54afe17a76513e04abe2e2ac5c3fa8..c722751d563e37650a14e59f34f4a28069d25d3f 100644 --- a/terraform/modules/compute/openstack/network.tf +++ b/terraform/modules/compute/openstack/network.tf @@ -66,14 +66,14 @@ resource "openstack_networking_port_v2" "worker_ip" { resource "openstack_networking_port_v2" "floating_ip" { count = var.floating_ip depends_on = [ openstack_networking_subnet_v2.cluster_subnet ] - name = format("%s-floating-ip-%03d", var.cluster_name, count.index + 1) + name = format("%s-floating-ip-%02d", var.cluster_name, count.index + 1) network_id = openstack_networking_network_v2.cluster_net.id } # create floating ip that is associated with a fixed ip resource "openstack_networking_floatingip_v2" "floating_ip" { count = var.floating_ip - description = format("%s-floating-ip-%03d", var.cluster_name, count.index + 1) + description = format("%s-floating-ip-%02d", var.cluster_name, count.index + 1) pool = data.openstack_networking_network_v2.ext_net.name port_id = element(openstack_networking_port_v2.floating_ip.*.id, count.index) } diff --git a/terraform/modules/compute/openstack/templates/agent_userdata.tmpl b/terraform/modules/compute/openstack/templates/agent_userdata.tmpl index 18602367926a2fc8aee03c8492534887db96b3b1..5454af0b655c0a0c88dfbaad87b61e79c0b80b3a 100644 --- a/terraform/modules/compute/openstack/templates/agent_userdata.tmpl +++ b/terraform/modules/compute/openstack/templates/agent_userdata.tmpl @@ -6,8 +6,8 @@ ssh: emit_keys_to_console: false # update and upgrade instance -#package_update: true -#package_upgrade: true +package_update: true +package_upgrade: true # files to be created on the system write_files: diff --git a/terraform/modules/compute/openstack/templates/server_userdata.tmpl b/terraform/modules/compute/openstack/templates/server_userdata.tmpl index 70a4b801784c093ed5709d47ff54cd66d6fa324a..2ef8e6fa7c5cdcd782bc5de9e265ded10ff4e0ef 100644 --- a/terraform/modules/compute/openstack/templates/server_userdata.tmpl +++ b/terraform/modules/compute/openstack/templates/server_userdata.tmpl @@ -5,9 +5,9 @@ no_ssh_fingerprints: false ssh: emit_keys_to_console: false -# update system -#package_update: true -#package_upgrade: true +# update and upgrade instance +package_update: true +package_upgrade: true # files to be created on the system write_files: diff --git a/terraform/modules/compute/openstack/variables.tf b/terraform/modules/compute/openstack/variables.tf index ce17ef8d167a12669b0503110500dfe4a2c3defb..d2676fea7a28a9a74d3ed7509dca2c593a43da2b 100644 --- a/terraform/modules/compute/openstack/variables.tf +++ b/terraform/modules/compute/openstack/variables.tf @@ -8,15 +8,17 @@ variable "cluster_type" { description = "Cluster type, can be either rke or rke2" default = "rke2" validation { - condition = var.cluster_type == "rke" || var.cluster_type == "rke2" - error_message = "Image needs to be one of [rke, rke2]." + #condition = var.cluster_type == "rke" || var.cluster_type == "rke2" + #error_message = "Image needs to be one of [rke, rke2]." + condition = var.cluster_type == "rke2" + error_message = "Currently only support rke2" } } variable "public_key" { type = string description = "path to public key to be injected into vm" - # + # leave as create_a_new_key to force a new key default = "create_a_new_key" }