galera-operator icon indicating copy to clipboard operation
galera-operator copied to clipboard

wrong result with operator galera metric

Open ldangeard-orange opened this issue 5 years ago • 1 comments

4 of 6 operator galera metric do not give the right values :

  • galera_operator_controller_clusters is the same value of galera_operator_controller_clusters_created, not number of clusters managed by the controller
  • galera_operator_controller_clusters_deleted, galera_operator_controller_clusters_failed and galera_operator_controller_clusters_modified always return 0

ldangeard-orange avatar Jun 29 '20 15:06 ldangeard-orange

You are right, the main problem is that Galera objects (in the k8s point of view) are deleted before entering the check loop, so the operator is notified of a change but as the object is already destroyed, it cannot process it. An attend was made using finalizers but it didn't follow the principle I followed in the operator design : Using sub resources and give :

  • for user : rights for write, delete and modify galera and only read for galera/status
  • for operator : read galera (galera/spec) and write, modify galera/status

As the operator is stateless, the only solution is to write a ConfigMap with all informations to have these metrics accurate

sebs42 avatar Jul 01 '20 07:07 sebs42