-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: default allow all users to use default psp
adjusts examples and mention psp binding
- Loading branch information
1 parent
0b5c9a3
commit 166f15d
Showing
4 changed files
with
50 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
resource "kubernetes_role" "use_psp" { | ||
count = var.enable_pod_security_policy ? 1 : 0 | ||
|
||
metadata { | ||
name = "psp-${var.pod_security_policy_name}" | ||
namespace = kubernetes_namespace.namespace.metadata.0.name | ||
} | ||
|
||
rule { | ||
api_groups = ["policy"] | ||
verbs = ["use"] | ||
resources = ["podsecuritypolicies"] | ||
resource_names = [var.pod_security_policy_name] | ||
} | ||
} | ||
|
||
resource "kubernetes_role_binding" "psp_binding" { | ||
count = var.enable_pod_security_policy ? 1 : 0 | ||
|
||
metadata { | ||
name = "psp-${var.pod_security_policy_name}" | ||
namespace = kubernetes_namespace.namespace.metadata.0.name | ||
} | ||
|
||
role_ref { | ||
name = join("", kubernetes_role.use_psp.*.metadata.0.name) | ||
api_group = "rbac.authorization.k8s.io" | ||
kind = "Role" | ||
} | ||
|
||
subject { | ||
kind = "Group" | ||
name = "system:authenticated" | ||
namespace = kubernetes_namespace.namespace.metadata.0.name | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ image_pull_secrets = { | |
docker config file | ||
} | ||
EOF | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters