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

cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers #98

Closed
zetaab opened this issue Oct 8, 2018 · 2 comments · Fixed by #161 or #329

Comments

@zetaab
Copy link

zetaab commented Oct 8, 2018

Expected behaviour

I want to install new redis HA setup in openshift

Actual behaviour

I can create redis-operator just fine. However, when I create new redisfailover with https://github.com/spotahome/redis-operator/blob/master/example/redisfailover/persistant-storage.yaml

the result is following (can be seen in redis operator logs)

time="2018-10-08T08:45:48Z" level=warning msg="error processing redis-operator/redisforcj job (requeued): services \"rfs-redisforcj\" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: User \"system:serviceaccount:redis-operator:redisoperator\" cannot update redisfailovers/finalizers.storage.spotahome.com in project \"redis-operator\", <nil>" controller=redisfailover operator=redisfailover src="generic.go:223"
time="2018-10-08T08:45:48Z" level=warning msg="error processing redis-operator/redisforcj job (requeued): services \"rfs-redisforcj\" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: User \"system:serviceaccount:redis-operator:redisoperator\" cannot update redisfailovers/finalizers.storage.spotahome.com in project \"redis-operator\", <nil>" controller=redisfailover operator=redisfailover src="generic.go:223"
time="2018-10-08T08:45:48Z" level=warning msg="error processing redis-operator/redisforcj job (requeued): services \"rfs-redisforcj\" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: User \"system:serviceaccount:redis-operator:redisoperator\" cannot update redisfailovers/finalizers.storage.spotahome.com in project \"redis-operator\", <nil>" controller=redisfailover operator=redisfailover src="generic.go:223"
time="2018-10-08T08:45:48Z" level=error msg="Error processing redis-operator/redisforcj: services \"rfs-redisforcj\" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: User \"system:serviceaccount:redis-operator:redisoperator\" cannot update redisfailovers/finalizers.storage.spotahome.com in project \"redis-operator\", <nil>" controller=redisfailover operator=redisfailover src="generic.go:223"

Steps to reproduce the behaviour

try installing redisfailover in openshift 3.9

Environment

How are the pieces configured?

  • Redis Operator version: latest
  • Kubernetes version: openshift 3.9 (kubernetes 1.9)
  • Kubernetes configuration used (eg: Is RBAC active?) rbac active

Logs

Please, add the debugging logs. In order to be able to gather them, add -debug flag when running the operator.

@jchanam
Copy link
Collaborator

jchanam commented Oct 8, 2018

Hi @zetaab,

I've never seen such those errors on any of our logs. Have you set any finalizer specifically? I think that you may fix this allowing (in the RBAC) the service account to access to the finalizers api.

I don't know if you have a special configuration or if OpenShift has it by default. Unfortunately, we cannot support OpenShift. Maybe some other user has faced this error before and knows how to fix it.

@b4456609
Copy link

Add redisfailovers/finalizers in storage.spotahome.com api group. It seems work. The following yaml is full clusterrole yaml.

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: redisoperator
rules:
- apiGroups:
    - storage.spotahome.com
  resources:
    - redisfailovers
    - redisfailovers/finalizers
  verbs:
    - "*"
- apiGroups:
    - apiextensions.k8s.io
  resources:
    - customresourcedefinitions
  verbs:
    - "*"
- apiGroups:
    - ""
  resources:
    - pods
    - services
    - endpoints
    - events
    - configmaps
  verbs:
    - "*"
- apiGroups:
    - apps
  resources:
    - deployments
    - statefulsets
  verbs:
    - "*"
- apiGroups:
    - policy
  resources:
    - poddisruptionbudgets
  verbs:
    - "*"

@ese ese closed this as completed in #161 Jun 19, 2019
Tal-or added a commit to Tal-or/numaresources-operator that referenced this issue Apr 12, 2022
Needed for setting KubeletConfig as the OwnerReference: spotahome/redis-operator#98

Signed-off-by: Talor Itzhak <titzhak@redhat.com>
Tal-or added a commit to Tal-or/numaresources-operator that referenced this issue Apr 12, 2022
Needed for setting KubeletConfig as the OwnerReference: spotahome/redis-operator#98

Signed-off-by: Talor Itzhak <titzhak@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants