forked from DrFaust92/terraform-kubernetes-efs-csi-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrbac.tf
70 lines (57 loc) · 1.45 KB
/
rbac.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
resource "kubernetes_cluster_role" "efs_csi_external_provisioner_role" {
metadata {
name = "${local.controller_name}-role"
labels = local.labels
}
rule {
verbs = ["get", "list", "watch", "create", "delete"]
api_groups = [""]
resources = ["persistentvolumes"]
}
rule {
verbs = ["get", "list", "watch", "update"]
api_groups = [""]
resources = ["persistentvolumeclaims"]
}
rule {
verbs = ["get", "list", "watch"]
api_groups = ["storage.k8s.io"]
resources = ["storageclasses"]
}
rule {
verbs = ["list", "watch", "create", "patch"]
api_groups = [""]
resources = ["events"]
}
rule {
verbs = ["get", "list", "watch"]
api_groups = ["storage.k8s.io"]
resources = ["csinodes"]
}
rule {
verbs = ["get", "list", "watch"]
api_groups = [""]
resources = ["nodes"]
}
rule {
verbs = ["get", "watch", "list", "delete", "update", "create"]
api_groups = ["coordination.k8s.io"]
resources = ["leases"]
}
}
resource "kubernetes_cluster_role_binding" "efs_csi_provisioner_binding" {
metadata {
name = "${local.controller_name}-binding"
labels = local.labels
}
subject {
kind = "ServiceAccount"
name = local.controller_name
namespace = var.namespace
}
role_ref {
api_group = "rbac.authorization.k8s.io"
kind = "ClusterRole"
name = "${local.controller_name}-role"
}
}