-
Notifications
You must be signed in to change notification settings - Fork 25
Add ability to install Gatekeeper into separate namespace from operator's namespace #87
Comments
We should consider making such a namespace field immutable to aid in unintended consequences for the user i.e. operator would delete Gatekeeper installation and re-create it in another namespace. Or plan to document the behavior very well. Making this field immutable forces the user to perform the delete and create operations explicitly. However, currently K8s CRDs does not have built-in support for immutability using the Instead, we'd need to use the traditional validating admission webhook approach to enforce immutability, which is a bit heavy. Considering the CRD support is being worked on, it would be preferable to use that approach if it will be resolved in the foreseeable future. |
@font, what's the current status of this? I was recently exploring installing the gatekeeper operator into different namespaces because in ROSA clusters, there is an admission webhook which prevents making new namespaces that start with |
There has been no progress on this as we are waiting for immutability support in CRDs before adding a namespace field to the CR to allow the user to pick the namespace to install Gatekeeper. The reason the operator installs GK to What admission webhook is preventing making new namespaces prefixed with |
Great questions, digging into this helped me understand why the "upstream" gatekeeper operator (installed via this ocm policy) wasn't working on ROSA but the "downstream" one (installed via this ocm policy) was working on ROSA. I believe the webhook is this one: https://github.com/openshift/managed-cluster-validating-webhooks/blob/master/pkg/webhooks/namespace/namespace.go Service accounts in an I had recently changed the "upstream" operator policy to create and install into the TL;DR - installing the operator into |
I think this line in the original issue is confusing:
At this point, Gatekeeper is installed into either |
Ah yes, I've now updated the sentence to specify Kubernetes as this issue (and the operator in general) is primarily targeting Kubernetes.
Where are you seeing that behavior? On Kubernetes, the operator installs Gatekeeper into the same namespace as the operator and this issue is primarily referring to that limitation. It's only on OpenShift that the operator uses a different canonical namespace |
Currently in Kubernetes we support installing Gatekeeper into any namespace as long as that namespace is also where the operator is running.
This issue tracks the work necessary to have the operator install Gatekeeper into any namespace separate from where the operator is running.
On vanilla Kubernetes, the operator may be running in one namespace, but the user may want Gatekeeper to be installed to the
gatekeeper-system
canonical namespace, or another namespace separate from the operator's namespace.On OpenShift, the operator may be installed into the
openshift-operators
namespace, but the operator should install Gatekeeper into a canonical namespace e.g.openshift-gatekeeper-system
.We should consider adding a
namespace
field to the Gatekeeper operator custom resource so the user could select which namespace is desired, and the operator should use a sane default if the user leaves it empty. This would require the operator to have permissions to create namespaces. Is this desirable?The text was updated successfully, but these errors were encountered: