mgr/cephadm: Use mon command to set grafana url in the dashboard#34592
mgr/cephadm: Use mon command to set grafana url in the dashboard#34592sebastian-philipp wants to merge 3 commits intoceph:masterfrom
Conversation
epuertat
left a comment
There was a problem hiding this comment.
If this comes from a user requesting:
The dashboard has grafana-api-url set to https://host:3000. I want to set it to https://host.domain.tld:3000, but my change gets revoked every time!
... can't we simply make cephadm FQDN aware? This does not only applies to Grafana, but also to every user-facing web server (Prometheus, Alertmanager, RGW, HAProxy...).
- url = 'https://%s:3000' % (self.inventory[host].get('addr', host))
+ url = 'https://%s:3000' % (socket.getfqdn(self.inventory[host].get('addr', host)))That should try to reverse lookup that IP/hostname into a FQDN. If that doesn't properly works, probably it's because some networking setting is missing. Alternatively, the inventory lookup could also resolve to FQDNs, which might allow users to set up complex networking with different domains.
|
Hi, Is there any chance that this will get fixed? We have to have the FQDN to access Grafana, as we have certs with a CN containing FQDN, and our users do not have hosts entries on their machines to access the system containing the Grafana container. This is a big deal for operations staff, who have already flagged this as a non-starter. |
To add context to this - if you use cephadm --bootstrap, and then FQDN, the grafana_api_url is set to the FQDN, but this is less than ideal, as there are some weird conditions that pop up with the list of services in the dashboard (i.e. any further hosts added only show the mgr daemon in the host list, and mons do not show up). However, if you don't skip the monitoring components when bootstrapping, it will set the API URL to https://host:3000 (not FQDN). This needs to be fixed if Grafana is going to be usable in the dashboard. |
f7a7757 to
1fce1de
Compare
0cac8ea to
2957e98
Compare
|
@ceph/dashboard I'm agreeing with Ernesto that the cleanest API is the Mon Command API. If that's ok for you, we should use that from now on. |
|
Actually, here is the workaround I utilized on Octopus: cephadm shell Tests on our environment result in FQDN being used for GRAFANA_API_URL, which is what we needed in order to have cert complaince, and for clients outside of the environment access to the monitoring dashboards through the Ceph dashboard. I think the permanent solution needs to be a couple of things:
|
epuertat
left a comment
There was a problem hiding this comment.
The code looks good (left some comments over there). Thanks for taking into account my suggestions!
| """ | ||
| Make sure, we have sane hostname. | ||
| """ |
There was a problem hiding this comment.
Maybe it's just me that took me a while to understand this function. Perhaps some comments would help.
So this results in cephadm either allowing all hosts as FQDN or as short hostnames? Is it that?
Wouldn't it be better to make this explicit? For example, FQDN would require '--fqdn' flag, otherwise short hostnames is assumed. I'm not much of a fan of validation rules changing implicitly.
There was a problem hiding this comment.
Wouldn't it be better to make this explicit? For example, FQDN would require '--fqdn' flag, otherwise short hostnames is assumed. I'm not much of a fan of validation rules changing implicitly.
that would require
Line 2254 in d347db2
to be moved into ceph itself. might be something for a follow-up pr
Use Dashboard's {get,set}-grafana-api-url
Fixes: https://tracker.ceph.com/issues/44877
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2957e98 to
9c8d900
Compare
|
|
it's up to @ceph/dashboard to allow users to access Grafana. |
Hey, @sebastian-philipp , why this change of mind? |
|
Mainly, cause (1) you took the responsibility to make this work and (2) I don't have any time to work on this. |
|
Just note the the current workaround of specifying the client's hostname of grafana in cephadm is wrong: cephadm prefers bare host names. If users need to access grafana using the FQDN, it's the dashboards responsibility to make this possible. |
|
So, this means no FQDN support at all, that including RGW or HAProxy, right? |
this means that dashbaord users have different requirements than cephadm. |
|
e.g.
|
Telling users to create a new Ceph cluster, just because they got a certificate work grafana just isn't going to work |
As I sometimes have issues understanding what cephadm is and what is not, I simply tried and replaced cephadm in that sentence with something I know better (ceph-ansible, k8s) and the result doesn't make sense to me. How's it possible that the configuration management tool is not responsible for something as essential as dealing with FQDNs and setting, where appropriate, either the FQDN or the short hostname... |
Ok, here are the glory details: Mainly because cephadm has different requirements and demands than ceph-ansible. cephadm has very minimal requirements when it comes to resolving host names etc. Cephadm executes
Second, Ceph itself uses Third, it turns out, there are two valid ways to set
quoting
Which means, Fourth, If the user now get a certificate with the "common name" pointing to the FQDN, we need a place for the user to make the dashboard return the FQDN instead of the bare name used by Ceph. To sum up, cephadm uses |
Fixes: https://tracker.ceph.com/issues/44877
Signed-off-by: Sebastian Wagner sebastian.wagner@suse.com
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard backendjenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox