-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Unable to Create Deployment for Memcached example using operator-sdk #3590
Comments
Hi @atef, Could you please run the following commands and add the output here?
PS. I am guessing that you are looking for the CR deployment in the ns of the operator. If when you run |
@camilamacedo86 thanks for providing those commands. here is the error I see repeatedly from the reconcile loop:
|
the output from oc get all: `[atefaziz@localhost ~]$ oc get all NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE NAME READY UP-TO-DATE AVAILABLE AGE NAME DESIRED CURRENT READY AGE |
@camilamacedo86 Here is my source for reference: https://github.com/atef23/memcached-operator I took the controller from the operator-sdk repository example controller: https://github.com/atef23/memcached-operator/blob/master/controllers/memcached_controller.go So I wonder if it's something related to RBAC policy? |
Could you please try to add on top of your reconcile the RBAC marker: // +kubebuilder:rbac:groups=apps,resources=deployments/finalizers,verbs=get;create;update;patch;delete And then, run |
@camilamacedo86 I updated that and then I get this error:
Do I need to add a different clusterrole to the service account? |
@camilamacedo86 I added this role to the manager-rolebinding:
Which works. Do I need to give it the cluster-admin role or can I get away with giving it less permissions? |
HI @atef23, The steps provide is expecting that the user logged has admin permission. See how to grant yourself cluster-admin privileges or be logged in as admin. (we need to clarify it in the docs) The projects are now cluster-scoped by default which means that the logged user requires permission in the cluster to apply the cluster-roles. However, users still able to customize their projects to work with namespaced scope. See; https://master.sdk.operatorframework.io/docs/building-operators/golang/operator-scope/ |
@camilamacedo86 I’ll take a look there. thanks for your help with this. I’ll close this issue. |
Let's keep this open for we make clear this point needs to be addressed in the docs. |
I'm going to move this out of the 1.0.0 milestone. A few comments and clarifications on the above discussion though.
Can you retry the latest quickstart using |
@joelanford thanks for taking a look. I was deploying it from a bundle I generated using |
@atef23 did you solve the problem? i also met this issue and i am using the
|
Hi, I see the same issue as described by atef23 on 29th July, but in my case the logs have No errors (RBAC or whatever). The link being followed is: Operator-sdk version is 1.1.0 This is on KOPS Kubernetes cluster on AWS. This has been tried on default namespace and memcached-operator-system namespace but both behave the same way. The controller log says: 2020-11-06T04:50:11.042Z DEBUG controller-runtime.controller Successfully Reconciled {"controller": "memcached", "request": "default/memcached-sample"} kubectl get crd -A kubectl get all -n memcached-operator-system NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE NAME READY UP-TO-DATE AVAILABLE AGE NAME DESIRED CURRENT READY AGE i.e. only the operator objects are shown and not the CR that's supposed to have been generated. However this shows the object: kubectl get Memcached Isn't it supposed to create a pod resource ? |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I am having the same issue where no pods were created. In fact the deploymet is having issues. |
Even I am having the same issue @kyp0717 , did you get any resolution? |
I was able to fix it by adding the following line before the reconcile function which would add the necessary permissions in the rbac/role.yaml
|
Type of question
Setting up a new project with operator sdk version 0.19
Question
What did you do?
Created a new Memcached golang operator using the guide for the operator-sdk here:
https://sdk.operatorframework.io/docs/golang/quickstart/
and the stock controller from the operator-sdk source:
https://github.com/operator-framework/operator-sdk/blob/master/example/memcached-operator/memcached_controller.go.tmpl
What did you expect to see?
A deployment created upon applying the cr for the Memcached CRD.
What did you see instead? Under which circumstances?
The Memcached CRD gets created and a pod with the controller using my Memcached operator image gets created but when I attempt to apply the CR and create instances of the Memcached operator which should create deployment objects, I don't see any events or errors but no deployment gets created either.
Environment
operator-sdk version:
v0.19.0
Kubernetes version information:
4.3.1
Additional context
I was able to get this working when creating an operator using the old scaffolding from operator-sdk v0.17
I see the instances of the Memcached operator but the controller doesn't create the deployment. Am I missing something with registering the controller with the manager or something?
Thanks,
Atef
The text was updated successfully, but these errors were encountered: