mgr/cephadm: allow custom dashboard grafana url#35747
Conversation
src/pybind/mgr/cephadm/module.py
Outdated
| ) | ||
| daemons.append(sd) | ||
| if daemon_type in ['grafana', 'iscsi', 'prometheus', 'alertmanager', 'nfs']: | ||
| self._get_cephadm_service(daemon_type).daemon_check_post([sd]) |
There was a problem hiding this comment.
instead of having this in _apply_service, what do you think of moving this into _create_daemon ?
There was a problem hiding this comment.
I think the reason I chose to put it in _apply_service over _create_daemon originally was because the redeploy command also goes through _create_daemon and I didn't want to alter the url in that case. If you think changing the url is also okay in that case then I could move it there.
There was a problem hiding this comment.
seems like we should update the dashboard urls during redeploy?
NFS pool/namespace could change during redeploy--
ceph/src/pybind/mgr/cephadm/services/nfs.py
Lines 74 to 95 in 07484c6
Similar for iscsi too --
ceph/src/pybind/mgr/cephadm/services/iscsi.py
Lines 64 to 90 in 07484c6
There was a problem hiding this comment.
Okay, in that case I will move it to _create_daemon where it should update during redeploy as well as when the placement changes
There was a problem hiding this comment.
Completely against about this change. ( overwrite when redeploy).
If we are redeploying the daemon in the same host... (it does not matter what daemon) probably this is because we want to upgrade the container image or restart the daemon.
Overwriting config values with default values is something that probably is not going to make very happy to the user that has change the settings.
I think that it is ok to use default or calculated values when you are deploying for first time a container in one host... but if it has been deployed .. there is a true possibility that the user had changed settings to customize the daemon behaviour. Overwriting config settings is always dangerous.... so my suggestion is not to do this kind of things. (in any daemon)
There was a problem hiding this comment.
Overwriting config settings is always dangerous.... so my suggestion is not to do this kind of things. (in any daemon)
Hence my suggestion to never overwrite any dashboard settings, but instead only provide default values for the dashboard.
Under the assumption that we go withthe solution to only overwrite the dashboard settings sometimes (like when deploying services, failovers etc), we have provide a way for users to "fix" the dashboard config, thus 👍 for also doing this on redeploy.
There was a problem hiding this comment.
Just an update on this. I've been trying to do the check post call within _create_daemon but have run into a problem where the mon commands it sends in the process (it sends a "dashboard get-grafana-api-url" and "dashboard set-grafana-apit url " both within the _check_and_set_dashboard function of services/cephadmservice.py) never returns. Furthermore, if I interrupt the redeploy to regain control and then try to manually get or set the grafana url afterwards those commands also don't return. I haven't been able to figure out why this is happening. For reference, I only intended to add the two highlighted lines here to the _create_daemon function. I'm still looking into it but I haven't had much luck.

There was a problem hiding this comment.
also, this seems to only be an issue during redeploy. _create_daemon runs fine with the daemon_check_post call during initial deployment and when changing placement.
There was a problem hiding this comment.
I don't think a direct call within _create_daemon is possible due to this https://docs.ceph.com/docs/master/dev/cephadm/#note-regarding-network-calls-from-cli-handlers
so I've tried this new method of setting a sort of flag within _create_daemon so the post actions can be handled after within the service loop to hopefully get the same outcome as doing the post actions in _create_daemon without the mon commands hanging
4a5f158 to
0329a5f
Compare
Instead of resetting grafana url to a default with each run of the service loop, only set it when initally deployed or when it's placement changes Fixes: https://tracker.ceph.com/issues/44877 Signed-off-by: Adam King <adking@redhat.com>
|
still lots of failures:
|
|
retest this please |
Instead of resetting grafana url to a default with
each run of the service loop, only set it when
initally deployed or when it's placement changes
Fixes: https://tracker.ceph.com/issues/44877
Signed-off-by: Adam King adking@redhat.com