-
Notifications
You must be signed in to change notification settings - Fork 231
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
Operator needs finalizer permission in RBAC to work in OpenShift #434
Comments
Hi @aelbarkani, we're sorry you ran into this issue. I believe this may likely be due to a permissions issue specific to your cluster since we test on vanilla K8s clusters to ensure Config Connector can install properly. If possible, we recommend using GKE clusters to ensure Config Connector works. After a brief investigation, I noticed some other GitHub issues mentioning a similar finalizer RBAC issue using OpenShift clusters and that OpenShift requires an additional RBAC permission for |
@aelbarkani, unfortunately, due to the nature of this issue (only appearing in ConfigConnector installations on OpenShift clusters), we don't have a reliable way to test our changes. One workaround you can try:
We're really sorry we don't currently support your use-case, and (again) would recommend using GKE clusters for an ensured smooth experience with ConfigConnector. |
If [OwnerReferencesPermissionEnforcement](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement) is turned on, such as on OpenShift, ConfigConnector operator would fail with error `forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on`
Apart from my #797 PR, the only other change I had to do to make operator run on OpenShift is to remove runAsUser and runAsGroup from manager container's securityContext. On OpenShift we enforce UID ranges for each namespace by default (which means the 1000 UID used by default won't work on OpenShift without messing with SecurityContextConstraints) The patch to run additional to current config-connector installation docs is following
Where the last op is to remove a warning. |
If [OwnerReferencesPermissionEnforcement](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement) is turned on, such as on OpenShift, ConfigConnector operator would fail with error `forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on` Signed-off-by: Tiger Kaovilai <[email protected]>
Looks like in addition to kaovilai@a756ff1 Other pods are going to need similar uid changes.. so perhaps I need to fork this operator. |
Investigating creating SecurityContextConstraints to enable running the operator and its resources without maintaining a fork image. |
Here's my wiki for getting ConfigConnector running on OpenShift. |
@kaovilai Thank you for providing the wiki and creating the PR! We appreciate your efforts! Apologies for the delayed response, we will try to review your contribution sooner. In the meantime, I wanted to check in on your investigation progress. Do you anticipate needing to fork the operator config to make it compatible with OpenShift? |
The PR is applicable to technically not just openshift, as it is a k8s native admission controller that just may not be on by default. I don't think we would wanna maintain a separate fork. The change is not much, mostly UID and perhaps creating SCC resource. I would be happy to contribute to upstream an "openshift mode". Otherwise the most I'd do is just wiki. I can write wiki here or add to readme here? |
TL;DR: Issues on OpenShift with current ConfigConnector
The wiki resolves all three issues in a way that do not require changes in GCP upstream. |
If [OwnerReferencesPermissionEnforcement](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement) is turned on, such as on OpenShift, ConfigConnector operator would fail with error `forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on` Signed-off-by: Tiger Kaovilai <[email protected]>
If [OwnerReferencesPermissionEnforcement](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement) is turned on, such as on OpenShift, ConfigConnector operator would fail with error `forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on` Signed-off-by: Tiger Kaovilai <[email protected]> Limit finalizers role to update verb Signed-off-by: Tiger Kaovilai <[email protected]>
@kaovilai Thanks for your contribution! Also could you please start another PR to add the OpenShift install instructions? Although we haven't yet finalized the document structure for this repository, you can start by adding a document under the path "docs/openshift". We can reorganize the folders as needed in the future. |
Checklist
Bug Description
We have an OKD cluster installed and we would like to use Config connector, which doesn't seem to work, probably because a problem in RBAC. It seems rights on finalizer subresources are needed
We have these error messages inside the operator pod:
forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on
Additional Diagnostic Information
Kubernetes Cluster Version
Client Version: v1.20.1-5-g76a04fc
Server Version: 4.6.0-0.okd-2021-02-14-205305
Kubernetes Version: v1.19.2-1049+f173eb4a83e557
Config Connector Version
1.42.0
Config Connector Mode
namespaced
Log Output
Error log:
Steps to Reproduce
Steps to reproduce the issue
We have followed the procedure explained here:
https://cloud.google.com/config-connector/docs/how-to/install-other-kubernetes
The text was updated successfully, but these errors were encountered: