Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbac modifications for permission issues #117

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/kubernetes/nodefilters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ func TestOldNodeLabelFilter(t *testing.T) {
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
labelExpr, err := ConvertLabelsToFilterExpr(tc.labels)
if err != nil {
t.Errorf("Label expression: %v, did not converted", err)
t.FailNow()
}

filter, err := NewNodeLabelFilter(labelExpr, log)
if err != nil {
Expand Down
51 changes: 32 additions & 19 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
---

apiVersion: v1
kind: ServiceAccount
metadata:
labels: {component: draino}
name: draino
namespace: kube-system

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels: {component: draino}
labels:
component: draino
name: draino
rules:
- apiGroups: ['']
resources: [events]
verbs: [create, patch, update]
- apiGroups: ['']
resources: [nodes]
verbs: [get, watch, list, update]
- apiGroups: ['']
resources: [nodes/status]
verbs: [patch]
- apiGroups: ['']
resources: [pods]
verbs: [get, watch, list]
- apiGroups: ['']
resources: [pods/eviction]
verbs: [create]
- apiGroups: [extensions]
resources: [daemonsets]
verbs: [get, watch, list]
- apiGroups: ['']
resources: [events]
verbs: [create, patch, update]
- apiGroups: ['']
resources: [nodes]
verbs: [get, watch, list, update, patch]
- apiGroups: ['']
resources: [nodes/status]
verbs: [get, watch, list, update, patch]
- apiGroups: ['']
resources: [endpoints]
verbs: [get, watch, list, create, patch, update]
- apiGroups: ['']
resources: [pods]
verbs: [get, watch, list]
- apiGroups: ['']
resources: [pods/eviction]
verbs: [create]
- apiGroups:
- extensions
- apps
resources: [daemonsets]
verbs: [get, watch, list]

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -39,7 +50,9 @@ metadata:
roleRef: {apiGroup: rbac.authorization.k8s.io, kind: ClusterRole, name: draino}
subjects:
- {kind: ServiceAccount, name: draino, namespace: kube-system}

---

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down