-
Notifications
You must be signed in to change notification settings - Fork 36
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
Feature req: Honor operatorframework.io/suggested-namespace #50
Comments
This seems like a bug to me at first glance. Would you mind filing a separate issue for that? Regarding the larger issue, I think it makes sense for Suppose
I see two main options:
There's probably some middle ground in between these options as well. I personally feel like there's a little too much "magic" behind option 1, since kubectl commands are typically pretty WYSIWYG. |
There is a third option off the top of my head, although it might be a bit less practical to implement than the others you've suggested: Provide an interface (such as something like envsubst) so that the operator can tailor resources like clusterrolebindings it would create toward the specific namespace that the namespaced serviceaccounts they create will have landed in. I do not have a strong opinion about 1 vs 2. Honoring the (2) seems a bit less helpful to me, but some people might prefer it as there is probably less potential for surprise. I am just starting out learning operator framework. Thanks for the response! I'll open a separate issue for the |
I don't know what went wrong last time, but the I renamed this issue for clarity, and explained what might have gone wrong in #51. |
I think (though I could be wrong) that the least surprising thing for
I would agree that As an aside, in an ideal world an operator should be able to be installed in any namespace and have its RBAC correctly bound based on the installation namespace. That's currently a limitation of OLM, so not much we can do about it right now.
A riff on (2) could be:
|
Related to this issue,
I am not sure how one can install an operator that does not support install mode "AllNamespaces" I began working with Operator Hub through the website, where the instructions have been fixed, but operator YAMLs are generally not namespaced correctly, at least according to the You can also use the OpenShift Console to install as I was informed, which honors suggested-namespace and works great for us, this is the preferred method I think as there are no special instructions required, as long as OLM is already in place and console is available somewhere. I am running OpenShift console in dev mode with a cluster-admin bearer token, so I should be able to do anything (I think, unless there are some things disabled by default in dev mode.) I try to install Keycloak, which has an operator of its own to deploy which is actually meant to be confined to within a namespace, at least as it appears: ... but it does not install with either method. Note that there is no entry widget for the namespace, perhaps it is because I do not have the Project namespace controller operator installed, so there are no Project namespaces for the operator to install itself into (?). Not sure where I can get that as a stand-alone component or if it is what I need. I guess I should try instructions from https://operatorhub.io/operator/keycloak-operator to be complete. I am not sure why the Krew Operator plugin This issue has a similar title and theme, but it is not the same issue: I am unfortunately not sure what other ways there are for creating an operator group besides It seemed close enough to this issue that I had already opened, I did not want to just spam and open up a separate one, (but if it is really a separate issue, maybe should be documented separately...) |
You should be able to use the
Also, just note that the OpenShift Console is a downstream OpenShift-specific component and is not under the CNCF operator-framework project, so there may be differences in features between the upstream kubectl plugin and downstream components (like the OpenShift Console) that do similar things. Any issues related to downstream projects should be created in downstream issue trackers. Just to reiterate:
|
@joelanford Would it be bad if we default to creating a default |
@dmesser That would be great actually. I think We basically need a set intersection of:
After the result of that set intersection, we could use a precedence order of:
Note that in reality, the only time we'll actually have more than one choice is if:
In that case, we would choose AllNamespaces. SingleNamespace is only an option when --watch is explicitly set to single namespace that is different than the install namespace or an existing OperatorGroup specifies a different namespace. MultiNamespaces is only an option when --watch is explicitly set to multiple namespaces or an existing OperatorGroup specifies multiples namespaces. |
This sounds good. We should prefer |
Alright, I think #54 improves the situation for auto-detecting supported install modes. |
I have been working on an operator which is listed in the Operator Hub catalog, and it has some resources (clusterrolebinding) which are expected to be created for service accounts in a certain namespace. The operator uses
operatorframework.io/suggested-namespace
to cajole the OpenShift console to install it into that namespace.When using OLM without OpenShift, I have found that suggested-namespace is not apparently honored. The result of this is some ServiceAccounts are created in the
operators
namespace, and the ClusterRoleBindings are bound to service account in the suggested namespace that do not exist. (It was easy enough to update the ClusterRoleBindings by hand, but this is easier done than said, in other words it will be a bad mark on our documentation if we have to explain this...)While in the long term the plan is to move away from service accounts and impersonate users instead, I'm not sure how to handle this in the short term. I understood that the OpenShift Console can be used outside of OpenShift, and that can be used to install operators and create namespaces, but that Operator Lifecycle Manager will not create namespaces by itself.
Would this be a reasonable feature addition to the kubectl-operator plugin? Is there somewhere else it should go besides OpenShift Console?
I haven't been through every page of the docs, but is there already a nice way to install the operator into a user-specified namespace at install time? (Would it help if I can create the namespace some other way?) I'm looking for the best way to resolve this, and someone suggested this kubectl plugin project might be a good place for this function to land.
Skimming through the options, I found there is a
-n
flag for namespace, but it does not appear to have the desired effect.(Flux still lands in the
operators
namespace.)The text was updated successfully, but these errors were encountered: