Skip to content

Commit

Permalink
metrics: fix missing rbac for sa ovn (#4312)
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Jul 19, 2024
1 parent 1078173 commit 68797a1
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
13 changes: 12 additions & 1 deletion charts/kube-ovn/templates/ovn-CR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,18 @@ rules:
verbs:
- get
- list

- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
15 changes: 14 additions & 1 deletion charts/kube-ovn/templates/ovn-CRB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@ subjects:
- kind: ServiceAccount
name: ovn
namespace: kube-system

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ovn
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
name: ovn
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
26 changes: 26 additions & 0 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3029,6 +3029,18 @@ rules:
verbs:
- get
- list
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -3042,6 +3054,20 @@ subjects:
- kind: ServiceAccount
name: ovn
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ovn
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
name: ovn
namespace: kube-system
EOF

cat <<EOF > kube-ovn-cni-sa.yaml
Expand Down

0 comments on commit 68797a1

Please sign in to comment.