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

[neutron] add rbac related parts for ovn #7852

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
67 changes: 67 additions & 0 deletions openstack/neutron/templates/rbac-ovn-db-raft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{{- if ((.Values).ovn).enabled | default false }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: ovnkube-db

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ovnkube-db
roleRef:
name: ovnkube-db
kind: ClusterRole
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: ovnkube-db
namespace: {{ .Release.Namespace }}

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ovnkube-db-ep
roleRef:
name: ovnkube-db-ep
kind: Role
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: ovnkube-db

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ovnkube-db
rules:
- apiGroups: [""]
resources:
- nodes
- namespaces
verbs: [ "get", "list", "watch" ]
Comment on lines +35 to +44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect we can patch that out: https://github.com/ovn-kubernetes/ovn-kubernetes/blob/d3b10e87f7fffa38fdf4ad52f98bc8ba998df6c2/dist/images/ovnkube.sh#L736-L743,
and then do not need access to the node api either.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now I'd like to keep it and do as less patching as needed since we should rewrite that with a proper operator anyway


# ovnkube-db startup scripts create an endpoint:
# https://github.com/ovn-org/ovn-kubernetes/blob/d3b10e87f7fffa38fdf4ad52f98bc8ba998df6c2/dist/images/ovnkube.sh#L699
# in HA statefulsets/pods are inspected
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: ovnkube-db-ep
rules:
- apiGroups: [""]
resources:
- endpoints
verbs: [ "get", "create" ]
- apiGroups: [""]
resources:
- pods
verbs: [ "get", "list" ]
- apiGroups: ["apps"]
resources:
- statefulsets
verbs: [ "get" ]
{{- end }}