galera-operator
galera-operator copied to clipboard
wrong result with operator galera metric
4 of 6 operator galera metric do not give the right values :
-
galera_operator_controller_clustersis the same value ofgalera_operator_controller_clusters_created, not number of clusters managed by the controller -
galera_operator_controller_clusters_deleted,galera_operator_controller_clusters_failedandgalera_operator_controller_clusters_modifiedalways return 0
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