summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2025-12-28 02:34:30 +0100
committerPatrick Spek <p.spek@tyil.nl>2025-12-28 02:34:30 +0100
commitb067174006aa95656edfaa26839ada2de5242c0b (patch)
tree0815516bbccc96bb82a95f8bd3ee7a2b1ffcbee2
parentf74123273728bbcd5f2b75e5f712c67afdf022d9 (diff)
downloadkubernetes-container-b067174006aa95656edfaa26839ada2de5242c0b.tar.gz
kubernetes-container-b067174006aa95656edfaa26839ada2de5242c0b.tar.bz2
Set default for allow_privilege_escalation based on privileged
-rw-r--r--deployment.tf2
-rw-r--r--main.tf2
2 files changed, 2 insertions, 2 deletions
diff --git a/deployment.tf b/deployment.tf
index 791ce85..0bb091d 100644
--- a/deployment.tf
+++ b/deployment.tf
@@ -84,7 +84,7 @@ resource "kubernetes_deployment_v1" "this" {
image_pull_policy = try(var.pull_policy, contains(local.container_tags_pull_always, local.container_tag) ? "Always" : null, "IfNotPresent")
security_context {
- allow_privilege_escalation = var.allow_privilege_escalation
+ allow_privilege_escalation = coalesce(var.allow_privilege_escalation, var.privileged)
privileged = var.privileged
read_only_root_filesystem = var.ro_rootfs
}
diff --git a/main.tf b/main.tf
index eb7cc7d..36272cd 100644
--- a/main.tf
+++ b/main.tf
@@ -54,7 +54,7 @@ variable "namespace" {
variable "allow_privilege_escalation" {
type = bool
- default = false
+ default = null
description = <<-EOF
Allow privilege escalation of the container. Be wary of security risks when
setting this to true. In Kubernetes manifests, this is equivalent to