Project

General

Profile

Bug #44923

Updated by Ernesto Puerta about 4 years ago

Only when the dashboard server_address is left to the default localhost (0.0.0.0 or ::) the stand-by ceph-mgr's dashboard redirects to a FQDN hostname. However, if the dashboard address is bound to a specific interface (192.0.2.1 for the active mgr, 192.0.2.2 for the stand-by mgr), then only that IP address is used: 

 <pre> 
 # curl http://192.0.2.2:8443 
 This resource can be found at <a href='http://192.0.2.1:8443/'>http://192.0.2.1:8443/</a>. 
 </pre> 

 Or: 
 <pre> 
 # ceph mgr services 
 { 
     "dashboard": "http://192.0.2.1:8443/", 
     "prometheus": "http://x.ceph-mgr.example.com:9283/" 
 } 
 </pre> 

 That full URI (including hostname) is provided by "the dashboard @serve() -> self.set_uri()@":https://github.com/ceph/ceph/pull/31430/files#diff-59964730926819ecda08a4ef0c395689R182 and uses python "@socket.getfqdn()@":https://docs.python.org/3/library/socket.html#socket.getfqdn. 

 Given that under containerized deployments the internal and external IP address will likely differ from the external ones, we should avoid returning a useless IP and either use, by default, the retrieved hostname or a configured one. 

 Additionally, returning IP address 'breaks' the seamless failover, as the browser cannot ensure that the IP address and the FQDN are the same web service (since HTTP servers may use the hostname part in the HTTP GET request to redirect to different virtual servers from the same IP:port). 

 OPEN QUESTION: would it be desirable that the mgr itself deals with this matter for all services? That way ceph-mgr modules only need to provide @(schema, port, port and base URL path)@ (while the hostname part is guessed by the ceph-mgr). path @(port, /login)@.

Back