Possible to use Keycloak Operator to install Realm on Keycloak provisioned by Helm chart?

I am hitting this bug which is not yet resolved:
https://issues.redhat.com/browse/KEYCLOAK-13394

There appear to be other issues with the Keycloak Operator that make it appear to be not ready for production at least on vanilla Kubernetes.

However, I would like to use the Keycloak Operator to manage realms, clients, and users that need to be bootstrapped for my microservices. Is it possible to use the Keycloak Operator with a Keycloak cluster provisioned using the Helm chart?

I tried using an instanceSelector in the KeycloakRealm spec to select the Keycloak cluster installed via Helm but the Operator gives this message:
{“level”:“info”,“ts”:1592493819.38956,“logger”:“controller_keycloakrealm”,“msg”:“found 0 matching keycloak(s) for realm myrealm/keycloak-realm”}

Perhaps it is not possible to use the Operator with Keycloak instances not created via the Operator?

Thanks.

@apapia I do not think that this would work, and even if you got it to work it would not be reliable long term. When using an Operator in K8s/OpenShift, the Operator needs to maintain ALL of the state for the application and manage ALL of it’s configuration. This is because of how the reconcile loop works in the Operator.

Thanks for the reply. I figured this was a shot in the dark but I’ve been looking for a good workaround. I’ve decided to just fork the operator repo and make the changes I need and build my own. Hopefully it isn’t too tricky and I can contribute back any changes that would be useful to others.

You may deploy the Keycloak Operator manually. You just need to put all the CRDs in your Kubernetes cluster as well as deployment.yaml. You will find them in the deploy directory of Keycloak Operator.