Terraform k8s deployments - Handle runAsUser/runAsGroup/run_as_non_root when not defined for (#53)

Handling use-case where kubernetes platform is openshift and
runAsUser/runAsGroup is not defined by a user; Openshift automatically
assigns runAsUser/runAsGroup.
This commit is contained in:
Jorge Falcon authored and GitHub committed 2025-05-30 10:05:42 -04:00
1 parent 770afe9cd3
commit 2b8b75199a
6 files changed
+52 -18

No files matched your search

+4 -4
View File
@@ -582,7 +582,7 @@ resource "kubernetes_deployment" "fleet" {
security_context {
run_as_user = local.fleet.security_context.run_as_user
run_as_group = local.fleet.security_context.run_as_group
run_as_non_root = "true"
run_as_non_root = local.fleet.security_context.run_as_non_root
read_only_root_filesystem = "true"
privileged = "false"
allow_privilege_escalation = "false"
@@ -696,9 +696,9 @@ resource "kubernetes_deployment" "fleet" {
},
privileged = false,
read_only_root_filesystem = true,
run_as_group = local.fleet.security_context.run_as_group,
run_as_user = local.fleet.security_context.run_as_user,
run_as_non_root = true
run_as_group = local.fleet.security_context.run_as_group,
run_as_non_root = local.fleet.security_context.run_as_non_root
}
}
] : []
@@ -870,4 +870,4 @@ resource "kubernetes_deployment" "fleet" {
depends_on = [
resource.kubernetes_job.migration // dependency should only be here if migration is enabled
]
}
}