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

luminous: common: get real hostname from container/pod environment #23915

merged 3 commits into from Sep 20, 2018


None yet
4 participants

liewegas commented Sep 4, 2018

Backport of #23798

liewegas added some commits Aug 29, 2018

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)
unittest_config: $host expands to ceph_get_short_hostname(), not host…
…name -s

Signed-off-by: Sage Weil <>
(cherry picked from commit c791609)
- conflict due to expand_meta changes
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)

# Conflicts:
#	src/common/
- conflict with APPLE special case in newer code

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

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

@smithfarm smithfarm added the common label Sep 4, 2018


for posterity: 0acb5cb and bd7e27d are not backported, as we don't have hostname in MMonSubscribe back in luminous.


This comment has been minimized.


yuriw commented Sep 15, 2018

@yuriw yuriw merged commit d359d89 into ceph:luminous Sep 20, 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