diff --git a/storage/onpremise/mongodb-sharded/main.tf b/storage/onpremise/mongodb-sharded/main.tf index d80f97980..c047e34b7 100644 --- a/storage/onpremise/mongodb-sharded/main.tf +++ b/storage/onpremise/mongodb-sharded/main.tf @@ -83,14 +83,14 @@ resource "helm_release" "mongodb" { "whenDeleted" = "Delete" } - "podSecurityContext" = { - "fsGroup" = var.security_context.fs_group - } - "containerSecurityContext" = { - "runAsUser" = var.security_context.run_as_user - "runAsGroup" = var.security_context.fs_group - } + "podSecurityContext" = { + "fsGroup" = var.security_context.fs_group } + "containerSecurityContext" = { + "runAsUser" = var.security_context.run_as_user + "runAsGroup" = var.security_context.fs_group + } + } "mongos" = { "replicaCount" = var.sharding.router.replicas @@ -228,4 +228,5 @@ resource "helm_release" "mongodb" { } } + depends_on = [kubernetes_storage_class.configsvr, kubernetes_storage_class.shards] } diff --git a/storage/onpremise/mongodb-sharded/persistence.tf b/storage/onpremise/mongodb-sharded/persistence.tf index 35950e27f..2166b4cf9 100644 --- a/storage/onpremise/mongodb-sharded/persistence.tf +++ b/storage/onpremise/mongodb-sharded/persistence.tf @@ -17,7 +17,7 @@ resource "kubernetes_storage_class" "shards" { } resource "kubernetes_storage_class" "configsvr" { - # enable if var.persistence.configsvr is not null and var.persistence.configsvr.storage_provisioner is neither null nor empty + # enable if var.persistence.configsvr.storage_provisioner is neither null nor empty count = can(coalesce(var.persistence.configsvr.storage_provisioner)) ? 1 : 0 metadata { name = "mongodb-configsvr"