Skip to content

Commit

Permalink
Add security context for configsvr and shards
Browse files Browse the repository at this point in the history
  • Loading branch information
tschneider-aneo committed Sep 4, 2024
1 parent 74562ba commit 3478e6c
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions storage/onpremise/mongodb-sharded/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,15 @@ resource "helm_release" "mongodb" {
"enabled" = true
"whenDeleted" = "Delete"
}
}

"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 @@ -115,11 +123,20 @@ resource "helm_release" "mongodb" {

"podLabels" = var.labels
"resources" = var.resources.shards
}

"persistentVolumeClaimRetentionPolicy" = {
"enabled" = true
"whenDeleted" = "Delete"

"persistentVolumeClaimRetentionPolicy" = {
"enabled" = true
"whenDeleted" = "Delete"
}

"podSecurityContext" = {
"fsGroup" = var.security_context.fs_group
}
"containerSecurityContext" = {
"runAsUser" = var.security_context.run_as_user
"runAsGroup" = var.security_context.fs_group
}
}

"arbiter" = {
Expand Down

0 comments on commit 3478e6c

Please sign in to comment.