Skip to content

Commit 1b2a96a

Browse files
committed
allow nix-csi to read and list all pods
required to farm their referenced storepaths
1 parent ba830b6 commit 1b2a96a

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

kubenix/rbac.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,33 @@ let
99
in
1010
{
1111
config = lib.mkIf cfg.enable {
12+
kubernetes.resources.none = {
13+
ClusterRole.nix-csi = mkNCSI {
14+
rules = [
15+
{
16+
apiGroups = [ "" ];
17+
resources = [ "pods" ];
18+
verbs = [
19+
"get"
20+
"list"
21+
];
22+
}
23+
];
24+
};
25+
ClusterRoleBinding.nix-csi = mkNCSI {
26+
subjects = lib.mkNamedList {
27+
nix-csi = {
28+
kind = "ServiceAccount";
29+
namespace = cfg.namespace;
30+
};
31+
};
32+
roleRef = {
33+
kind = "ClusterRole";
34+
name = "nix-csi";
35+
apiGroup = "rbac.authorization.k8s.io";
36+
};
37+
};
38+
};
1239
kubernetes.resources.${cfg.namespace} = {
1340
ServiceAccount.nix-csi = mkNCSI { };
1441

0 commit comments

Comments
 (0)