-
Notifications
You must be signed in to change notification settings - Fork 23
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
Cannot set blockOwnerDeletion #389
Comments
Thank you for the report. We also do not have experience with OpenShift, so need help. |
@cyberox
Please add the following rule in - apiGroups:
- ""
resources:
- persistentvolumeclaims/finalizers
verbs:
- update If it works, we will add this configuration to our helm chart. |
Thank you for the suggestion. I applied it to the clusterrole, and redeployed the MySQLCluster resource. |
Please add the following rule as well. - apiGroups:
- apps
resources:
- statefulsets/finalizer
verbs:
- update |
I also added that to the clusterrole, but unfortunately it is not working. |
I will try OpenShift free trial or Minishift. |
So I've stumbled over this problem on my OKD 4.18 cluster. The reason this is happening is that After a long debugging session I've managed to come by with the following RBAC: apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: mysqlclusters-finalizer
rules:
- apiGroups: ["moco.cybozu.com"]
resources: ["mysqlclusters/finalizers"]
verbs: ["update"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: mysqlclusters-finalizer-role-binding
subjects:
- kind: ServiceAccount
name: statefulset-controller
namespace: kube-system
roleRef:
kind: ClusterRole
name: mysqlclusters-finalizer
apiGroup: rbac.authorization.k8s.io However, I want to stress that I don't think this is the proper way, giving out roles to system processes just feels wrong. I'd like to research how other operators handle this before proposing a change in Moco, but I'm not too optimistic I'd find much, because OpenShift support is too often an afterthought. A connected issue is #777 -- OpenShift does not like hard-coded UIDs and GIDs and currently requires adding @zoetrope @ymmt2005 could you re-open this one please? I think we might find a proper solution soon. |
Thank you for your report, @rassie ! |
I think I have identified the problem, at least in comparison with other operators. I think the owner reference on the PVC is wrong: moco/controllers/mysqlcluster_controller.go Lines 1963 to 1969 in 699d878
From what I've seen from other operators, if a PVC has an owner reference, it's most commonly owned by the I'm not quite sure why the owner reference is set like that, but I suspect it has something to do with PVC resizing support which needs a certain decoupling of |
Describe the bug
I would like to run moco on our openshift cluster. The operator is installed correctly.
But during the creation of a MySQLCluster resource, I receive the following error:
Environments
To Reproduce
Deploy the minimal cluster resource on the openshift cluster.
Expected behavior
PVC are created correctly
Additional context
This is a security enhancement in OpenShift, and is discussed in this BugZilla.
This could be resolved by extending the ClusterRole resources with additional
/finalizers
, but I need some help with this.The text was updated successfully, but these errors were encountered: