Closed andreaTP closed 2 weeks ago
Which version of the extension are you using? 2.0.3 should have fixes for this issue.
I'm using 3.0.0-SNAPSHOT
this is still generating a null
namespace in case I don't have a globally defined one (which I would like to avoid since people should be free to install without hassle to whatever namespace they prefer)
There should be a warning in the console about this, no?
Yes there is a warning:
'realmcontroller' controller is configured to watch all namespaces, this requires a ClusterRoleBinding for which we MUST specify the namespace of the operator ServiceAccount. This can be specified by setting the 'quarkus.kubernetes.namespace' property. However, as this property is not set, we are leaving the namespace blank to be provided by the user by editing the 'realmcontroller-cluster-role-binding' ClusterRoleBinding to provide the namespace in which the operator will be deployed.
but we don't have a "realm" solution.
That said if your operator only needs to watch a single namespace, you can configure it to simply watch the namespace in which it will be deployed and that should work…
The end goal is to deploy Cluster wide, but watching one namespace is useful for testing e.g.
Then if it's for testing, people will know when deploying the namespace they want to watch and can therefore pass it via the quarkus.kubernetes.namespace
property or am I missing something?
I want it to be easily customizable by end users.
But I think I found a "good enough" solution using kustomize
this is the reference:
which is:
namespace
in kustomizeuse a replacement
the subjects.[...].namespace
field based on it
namespace: keycloak
replacements:
Wondering if something like https://quarkus.io/guides/deploying-to-kubernetes#environment-variables-from-fields could be used for this… 🤔
I do believe that the end user of an operator will not even know that the operator runs on Quarkus and they just want to deploy it using some "standard" and agnostic Kubernetes tooling.
But the Quarkus extension can be useful during development for sure.
Closing this as I believe it's addressed with the quarkus.operator-sdk.generate-with-watched-namespaces
property. Please re-open if needed with additional details.
A default Controller generates the an invalid related
ClusterRoleBinding
.e.g.:
This is not applicable to Kubernetes and it fails with:
since the
namespace
is a mandatory field.