Skip to content

Commit cc899d1

Browse files
author
Klaus Ma
authored
Merge pull request volcano-sh#23 from volcano-sh/bug/fix_rbac_issue
2 parents fce17d0 + 67365ba commit cc899d1

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

installer/chart/volcano/templates/controllers.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ rules:
3131
verbs: ["create", "list", "watch", "update", "patch"]
3232
- apiGroups: [""]
3333
resources: ["pods"]
34-
verbs: ["create", "list", "watch", "update"]
34+
verbs: ["create", "get", "list", "watch", "update", "bind", "delete"]
3535
- apiGroups: [""]
3636
resources: ["persistentvolumeclaims"]
3737
verbs: ["get", "list", "watch", "create"]

installer/chart/volcano/templates/scheduler.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ rules:
2424
resources: ["events"]
2525
verbs: ["create", "list", "watch", "update", "patch"]
2626
- apiGroups: [""]
27-
resources: ["pods"]
27+
resources: ["pods", "pods/status"]
2828
verbs: ["create", "get", "list", "watch", "update", "bind", "updateStatus", "delete"]
2929
- apiGroups: [""]
3030
resources: ["pods/binding"]
@@ -50,6 +50,12 @@ rules:
5050
- apiGroups: ["policy"]
5151
resources: ["poddisruptionbudgets"]
5252
verbs: ["list", "watch"]
53+
- apiGroups: ["scheduling.incubator.k8s.io"]
54+
resources: ["queues"]
55+
verbs: ["get", "list", "watch", "create", "delete"]
56+
- apiGroups: ["scheduling.k8s.io"]
57+
resources: ["priorityclasses"]
58+
verbs: ["get", "list", "watch"]
5359

5460
---
5561
kind: ClusterRoleBinding

pkg/controllers/job/job_controller_actions.go

+6
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ func (cc *Controller) killJob(jobInfo *apis.JobInfo, nextState state.NextStateFn
6868
err := cc.kubeClients.CoreV1().Pods(pod.Namespace).Delete(pod.Name, nil)
6969
if err != nil {
7070
running++
71+
glog.Errorf("Failed to delete pod %s for Job %s, err %#v",
72+
pod.Name, job.Name, err)
7173
errs = append(errs, err)
7274
continue
7375
}
@@ -76,6 +78,8 @@ func (cc *Controller) killJob(jobInfo *apis.JobInfo, nextState state.NextStateFn
7678
err := cc.kubeClients.CoreV1().Pods(pod.Namespace).Delete(pod.Name, nil)
7779
if err != nil {
7880
pending++
81+
glog.Errorf("Failed to delete pod %s for Job %s, err %#v",
82+
pod.Name, job.Name, err)
7983
errs = append(errs, err)
8084
continue
8185
}
@@ -86,6 +90,8 @@ func (cc *Controller) killJob(jobInfo *apis.JobInfo, nextState state.NextStateFn
8690
err := cc.kubeClients.CoreV1().Pods(pod.Namespace).Delete(pod.Name, nil)
8791
if err != nil {
8892
failed++
93+
glog.Errorf("Failed to delete pod %s for Job %s, err %#v",
94+
pod.Name, job.Name, err)
8995
errs = append(errs, err)
9096
continue
9197
}

0 commit comments

Comments
 (0)