oracle-database-operator
oracle-database-operator copied to clipboard
OraOperator 1.1 cannot reconcile on SingleInstanceDatabases and PDBs properly
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/[email protected]/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
---