mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
Add read Workload permissions to kube-scheduler
This commit is contained in:
parent
c086bdeaa2
commit
4a067cc022
2 changed files with 12 additions and 0 deletions
|
|
@ -66,6 +66,7 @@ const (
|
|||
internalAPIServerGroup = "internal.apiserver.k8s.io"
|
||||
admissionRegistrationGroup = "admissionregistration.k8s.io"
|
||||
storageVersionMigrationGroup = "storagemigration.k8s.io"
|
||||
schedulingGroup = "scheduling.k8s.io"
|
||||
)
|
||||
|
||||
func addDefaultMetadata(obj runtime.Object) {
|
||||
|
|
@ -649,6 +650,9 @@ func ClusterRoles() []rbacv1.ClusterRole {
|
|||
kubeSchedulerRules = append(kubeSchedulerRules, rbacv1helpers.NewRule(Read...).Groups(resourceGroup).Resources("devicetaintrules").RuleOrDie())
|
||||
}
|
||||
}
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.GenericWorkload) {
|
||||
kubeSchedulerRules = append(kubeSchedulerRules, rbacv1helpers.NewRule(Read...).Groups(schedulingGroup).Resources("workloads").RuleOrDie())
|
||||
}
|
||||
roles = append(roles, rbacv1.ClusterRole{
|
||||
// a role to use for the kube-scheduler
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "system:kube-scheduler"},
|
||||
|
|
|
|||
|
|
@ -976,6 +976,14 @@ items:
|
|||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- scheduling.k8s.io
|
||||
resources:
|
||||
- workloads
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
|
|
|
|||
Loading…
Reference in a new issue