Skip to content

Commit

Permalink
feat: (PSKD-709) Additional updates and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
riragh committed Oct 24, 2024
1 parent 7e4fc3c commit 86c9c73
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 23 deletions.
13 changes: 6 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,12 @@ module "google_netapp" {

count = var.storage_type == "ha" && local.storage_type_backend == "netapp" ? 1 : 0

prefix = var.prefix
region = local.region
network = module.vpc.network_name
service_level = var.netapp_service_level
capacity_gib = var.netapp_capacity_gib
protocols = var.netapp_protocols
# netapp_subnet_cidr = var.netapp_subnet_cidr
prefix = var.prefix
region = local.region
network = module.vpc.network_name
service_level = var.netapp_service_level
capacity_gib = var.netapp_capacity_gib
protocols = var.netapp_protocols
volume_path = "${var.prefix}-${var.netapp_volume_path}"
allowed_clients = join(",", [local.gke_subnet_cidr, local.misc_subnet_cidr])
}
2 changes: 1 addition & 1 deletion modules/google_netapp/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ output "mountpath" {

output "export_ip" {
value = split(":", google_netapp_volume.netapp-nfs-volume.mount_options[0].export_full)[0]
}
}
6 changes: 0 additions & 6 deletions modules/google_netapp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,3 @@ variable "allowed_clients" {
type = string
default = "0.0.0.0/0"
}

# variable "netapp_subnet_cidr" {
# description = "Address space for Google NetApp Volumes subnet"
# type = string
# default = "192.168.5.0/24"
# }
8 changes: 1 addition & 7 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ variable "storage_type_backend" {

validation {
condition = contains(["nfs", "filestore", "netapp", "none"], lower(var.storage_type_backend))
error_message = "ERROR: Supported values for `storage_type_backend` are nfs, filestore, netapp and none."
error_message = "ERROR: Supported values for `storage_type_backend` are nfs, filestore, netapp or none."
}
}

Expand Down Expand Up @@ -566,12 +566,6 @@ variable "database_subnet_cidr" {
default = "192.168.4.0/23"
}

# variable "netapp_subnet_cidr" {
# description = "Address space for Google NetApp Volumes subnet"
# type = string
# default = "192.168.5.0/24"
# }

variable "gke_network_policy" {
description = "Sets up network policy to be used with GKE CNI. Network policy allows us to control the traffic flow between pods. Currently supported values are true (calico) and false (kubenet). Changing this forces a new resource to be created."
type = bool
Expand Down
4 changes: 2 additions & 2 deletions vms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ locals {
: var.storage_type == "ha" && local.storage_type_backend == "filestore" ? "/${google_filestore_instance.rwx[0].file_shares[0].name}"
: var.storage_type == "ha" && local.storage_type_backend == "netapp" ? "/${module.google_netapp[0].mountpath}" : "/export"
)
protocol_version = var.storage_type == "ha" && var.storage_type_backend == "netapp" ? split("V", var.netapp_protocols[0])[1] == "4" ? "4.1" : "3" : "3"
protocol_version = var.storage_type == "ha" && local.storage_type_backend == "netapp" ? split("V", var.netapp_protocols[0])[1] == "4" ? "4.1" : "3" : "3"

}

module "nfs_server" {
source = "./modules/google_vm"
project = var.project
count = var.storage_type == "standard" && var.storage_type_backend == "nfs" ? 1 : 0
count = var.storage_type == "standard" && local.storage_type_backend == "nfs" ? 1 : 0
create_public_ip = var.create_nfs_public_ip

name = "${var.prefix}-nfs-server"
Expand Down

0 comments on commit 86c9c73

Please sign in to comment.