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

OraOperator 1.1 cannot reconcile on SingleInstanceDatabases and PDBs properly #148

Open
ilfur opened this issue Sep 26, 2024 · 1 comment
Assignees

Comments

@ilfur
Copy link

ilfur commented Sep 26, 2024

First I thought this was my own setup problem in my environment. Now I tried a new OBaaS 1.3 quick install and found that the included OraOperator has the same problem. So here is the problem and a quick fix for it:

OraOperator container log shows error messages of the kind
pkg/mod/k8s.io/client-go@v0.29.2/tools/cache/reflector.go:229: failed to list *v1.Node: nodes is forbidden: User "system:serviceaccount:oracle-database-operator-system:default" cannot list resource "nodes" in API group "" at the cluster scope
So resources like SingleInstanceDatabase and even PDBs will not show proper status , connect infos and stuff. Provisioning them is working though. I needed to apply one more Role for that to work. Please add that Role (to list and watch nodes everywhere) to the OraOperator installation yamls. Here is my example:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: oracle-database-operator-manager-role-node
rules:
- apiGroups:
  - ""
  resources:
  - nodes
  verbs:
  - list
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: oracle-database-operator-manager-role-node-cluster-role-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: oracle-database-operator-manager-role-node
subjects:
- kind: ServiceAccount
  name: default
  namespace: oracle-database-operator-system
---

@IshaanDesai45
Copy link
Member

@ilfur this role and roleBinding was decoupled because users generally don't want to give operator pod access to the nodes by default which might become a security concern. If you use a LoadBalancer service instead of a NodePort service you won't face this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants