Skip to content

Commit be7f71f

Browse files
authored
Merge pull request #818 from EladDolev/helm_fix_rbac
Dynamically add required RBAC in Helm chart
2 parents 3d63730 + 6533876 commit be7f71f

File tree

1 file changed

+25
-15
lines changed
  • manifests/install/charts/as-a-second-scheduler/templates

1 file changed

+25
-15
lines changed

manifests/install/charts/as-a-second-scheduler/templates/rbac.yaml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,23 @@ rules:
6262
- apiGroups: ["topology.node.k8s.io"]
6363
resources: ["noderesourcetopologies"]
6464
verbs: ["get", "list", "watch"]
65-
# resources need to be updated with the scheduler plugins used
6665
- apiGroups: ["scheduling.x-k8s.io"]
6766
resources: ["podgroups", "elasticquotas", "podgroups/status", "elasticquotas/status"]
6867
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
69-
# for network-aware plugins add the following lines
70-
#- apiGroups: [ "appgroup.diktyo.x-k8s.io" ]
71-
# resources: [ "appgroups" ]
72-
# verbs: [ "get", "list", "watch", "create", "delete", "update", "patch" ]
73-
#- apiGroups: [ "networktopology.diktyo.x-k8s.io" ]
74-
# resources: [ "networktopologies" ]
75-
# verbs: [ "get", "list", "watch", "create", "delete", "update", "patch" ]
76-
#- apiGroups: ["security-profiles-operator.x-k8s.io"]
77-
# resources: ["seccompprofiles", "profilebindings"]
78-
# verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
68+
{{- /* resources need to be updated with the scheduler plugins used */}}
69+
{{- if has "NetworkOverhead" .Values.plugins.enabled }}
70+
- apiGroups: [ "appgroup.diktyo.x-k8s.io" ]
71+
resources: [ "appgroups" ]
72+
verbs: [ "get", "list", "watch", "create", "delete", "update", "patch" ]
73+
- apiGroups: [ "networktopology.diktyo.x-k8s.io" ]
74+
resources: [ "networktopologies" ]
75+
verbs: [ "get", "list", "watch", "create", "delete", "update", "patch" ]
76+
{{- end }}
77+
{{- if has "SySched" .Values.plugins.enabled }}
78+
- apiGroups: ["security-profiles-operator.x-k8s.io"]
79+
resources: ["seccompprofiles", "profilebindings"]
80+
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
81+
{{- end }}
7982
---
8083
kind: ClusterRoleBinding
8184
apiVersion: rbac.authorization.k8s.io/v1
@@ -107,13 +110,20 @@ rules:
107110
- apiGroups: ["topology.node.k8s.io"]
108111
resources: ["noderesourcetopologies"]
109112
verbs: ["get", "list", "watch"]
110-
# resources need to be updated with the scheduler plugins used
111113
- apiGroups: ["scheduling.x-k8s.io"]
112114
resources: ["podgroups", "elasticquotas", "podgroups/status", "elasticquotas/status"]
113115
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
114-
#- apiGroups: ["security-profiles-operator.x-k8s.io"]
115-
# resources: ["seccompprofiles", "profilebindings"]
116-
# verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
116+
{{- /* resources need to be updated with the scheduler plugins used */}}
117+
{{- if has "PreemptionToleration" .Values.plugins.enabled }}
118+
- apiGroups: ["scheduling.k8s.io"]
119+
resources: ["priorityclasses"]
120+
verbs: ["get", "list", "watch"]
121+
{{- end }}
122+
{{- if has "SySched" .Values.plugins.enabled }}
123+
- apiGroups: ["security-profiles-operator.x-k8s.io"]
124+
resources: ["seccompprofiles", "profilebindings"]
125+
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
126+
{{- end }}
117127
---
118128
kind: ClusterRoleBinding
119129
apiVersion: rbac.authorization.k8s.io/v1

0 commit comments

Comments
 (0)