Skip to content

Commit

Permalink
Explicit dependance for the Helm chart on custom storage classes
Browse files Browse the repository at this point in the history
  • Loading branch information
tschneider-aneo committed Sep 6, 2024
1 parent 3478e6c commit 91e8ee6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions storage/onpremise/mongodb-sharded/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -228,4 +228,5 @@ resource "helm_release" "mongodb" {
}
}

depends_on = [kubernetes_storage_class.configsvr, kubernetes_storage_class.shards]
}
2 changes: 1 addition & 1 deletion storage/onpremise/mongodb-sharded/persistence.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 91e8ee6

Please sign in to comment.