New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimic: common: get real hostname from container/pod environment #23916

merged 5 commits into from Oct 29, 2018


None yet
5 participants
Copy link

liewegas commented Sep 4, 2018

Backport of #23798

liewegas added some commits Aug 29, 2018

common/util: pass real hostname when running in kubernetes/rook conta…

Rook will set up some environment variables to tell us what pod, pod
namespace, and physical host we are running on.  If we see them, set
'hostname' according to the hardware host, and include the pod info
in our metadata.

This allows the usual host-based logic on Ceph to work correctly, like
placing OSDs automatically in the CRUSH map.

Signed-off-by: Sage Weil <>
(cherry picked from commit 44db754)
mon: pay attention to MMonSubscribe's hostname
We weren't populating remote_host anywhere!

Signed-off-by: Sage Weil <>
(cherry picked from commit 0acb5cb)
common/hostname: use NODE_NAME environment variable insetad, if set
This is set by rook to the physical node.

Signed-off-by: Sage Weil <>
(cherry picked from commit e583f80)
mon/MonClient: set hostname in MMonSubscribe message
Signed-off-by: Sage Weil <>
(cherry picked from commit bd7e27d)

# Conflicts:
#	src/mon/
- conflict with sub_want refactor in master
unittest_config: $host expands to ceph_get_short_hostname(), not host…
…name -s

Signed-off-by: Sage Weil <>
(cherry picked from commit c791609)

@liewegas liewegas added this to the mimic milestone Sep 4, 2018

@liewegas liewegas requested a review from tchaikov Sep 4, 2018

@smithfarm smithfarm added the common label Sep 4, 2018


This comment has been minimized.

Copy link

yuriw commented Oct 23, 2018

@yuriw yuriw merged commit 3238ff6 into ceph:mimic Oct 29, 2018

4 checks passed

Docs: build check OK - docs built
Signed-off-by all commits in this PR are signed
Unmodified Submodules submodules for project are unmodified
make check make check succeeded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment