Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

prometheus service monitor naming #448

Closed
nemerna opened this issue Jan 18, 2022 · 2 comments
Closed

prometheus service monitor naming #448

nemerna opened this issue Jan 18, 2022 · 2 comments

Comments

@nemerna
Copy link

nemerna commented Jan 18, 2022

Describe the bug

when creating 2 keycloak instances (not 2 replicas) the 2nd instance will try to create same prometheus service monitor
then the operator will fail to create the prometheus resources because they exists and already monitoring the 1st keycloak instance

below is the status of the 2 clusters
1st cluster:
message: ''
phase: reconciling
ready: true
secondaryResources:
ServiceMonitor:
- keycloak-service-monitor
PrometheusRule:
- keycloak

2nd cluster:
message: >-
prometheusrules.monitoring.coreos.com "keycloak" is forbidden: cannot set an
ownerRef on a resource you can't delete: ,
phase: failing
ready: false
secondaryResources:
ServiceMonitor:
- keycloak-service-monitor
PrometheusRule:
- keycloak

Version

16.1.0

Expected behavior

create the service monitor/extra resources based on the keycloak cluster name

Actual behavior

message: >-
prometheusrules.monitoring.coreos.com "keycloak" is forbidden: cannot set an
ownerRef on a resource you can't delete: ,
phase: failing
ready: false
secondaryResources:
ServiceMonitor:
- keycloak-service-monitor
PrometheusRule:
- keycloak

How to Reproduce?

No response

Anything else?

No response

@andreaTP
Copy link
Contributor

Hi @nemerna ,

thanks for opening this issue.
Let me ask one question:
Are you installing the 2 instances in the same namespace?

Taking a brief look at the code this feature looks not supported at the moment.

Although you can attempt an unsupported hack by creating a matching ServiceMonitor named keycloak-service-monitor without OwnerReferences before creating the Keycloak CRs; this approach has a number of downsides and pitfalls of course.

@andreaTP
Copy link
Contributor

As this issue has been around for a long time we are closing this issue as out of date. If the issue is still valid, please verify with the latest version of the Keycloak operator, feel free to reopen and provide details to why it is still valid.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants