Skip to content
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

pacific: cephadm: mount host /etc/hosts for daemon containers in podman deployments #51174

Merged
merged 2 commits into from May 1, 2023

Conversation

trociny
Copy link
Contributor

@trociny trociny commented Apr 21, 2023

backport tracker: https://tracker.ceph.com/issues/59237


backport of #49824
parent tracker: https://tracker.ceph.com/issues/58532

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh

Podman messes with the /etc/hosts file in certain version. There
was already a past issue with it placing the container name
there fixed by ceph#42242. This time
it is adding an entry for "host.containers.internal" (seems to be
podman 4.1 onward currently). Iscsi figures out the FQDN for a
host by running

python3 -c 'import socket; print(socket.getfqdn())

which is resolving to "host.containers.internal" when run in
the container with the podman modified /etc/hosts.

There is also an issue with grafana dashboard with
this entry present

Passing --no-hosts resolves this, but I think in the past
we avoided that due to not wanting to break deployments
where host name resolution was handled using /etc/hosts.
That's why we had that workaround previously linked. This
time I'm not sure such a workaround exists. The try here
is to mount a copy of the host's version of /etc/hosts
into the iscsi container. That copy won't have the extra
entry podman adds in but will have any user created entries in
case they were actually using it for host name resolution.
If /etc/hosts file isn't present for whatever reason, we're
assuming that this user isn't using /etc/hosts for hostname
resolution, and just going back to passing --no-hosts.

Fixes: https://tracker.ceph.com/issues/58532
Fixes: https://tracker.ceph.com/issues/57018

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit dd8627b)
…hosts

To make sure we aren't being affected by any podman introduced
changes to the /etc/hosts file and test that we're properly
mounting /etc/hosts in our daemon containers

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 5493e2d)

Conflicts:
	qa/suites/orch/cephadm/dashboard/0-distro/centos_8.stream_container_tools.yaml
	qa/suites/orch/cephadm/thrash-old-clients/0-size-min-size-overrides/.qa
	qa/suites/orch/cephadm/workunits/task/test_iscsi_container/.qa
	qa/suites/orch/cephadm/workunits/task/test_iscsi_container/centos_8.stream_container_tools.yaml
	qa/suites/orch/cephadm/workunits/task/test_iscsi_container/test_iscsi_container.yaml
	qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit.yaml
	qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/.qa
	qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/centos_8.stream_container_tools.yaml
	qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/test_iscsi_pids_limit.yaml
	   (due to test_iscsi_pids_limit not backported)
@trociny trociny requested a review from a team as a code owner April 21, 2023 17:25
@trociny trociny added this to the pacific milestone Apr 21, 2023
@github-actions github-actions bot added the tests label Apr 21, 2023
@adk3798
Copy link
Contributor

adk3798 commented May 1, 2023

https://pulpito.ceph.com/adking-2023-04-25_18:48:20-orch:cephadm-wip-adk4-testing-2023-04-25-1313-pacific-distro-default-smithi/

reruns of failed jobs: https://pulpito.ceph.com/adking-2023-05-01_11:51:02-orch:cephadm-wip-adk4-testing-2023-04-25-1313-pacific-distro-default-smithi/

After reruns, 4 failures:

  • 2 tests still hit the remote connection issue that caused most of the 24 failures in the first run and happens before the test itself actually starts.
  • Other 2 failures were on the dashboard test_e2e test that has been known t fail in pacific runs

Overall, nothing to block merging

Notably for this PR, the test_iscsi_container test passed
https://pulpito.ceph.com/adking-2023-04-25_18:48:20-orch:cephadm-wip-adk4-testing-2023-04-25-1313-pacific-distro-default-smithi/7252278
https://pulpito.ceph.com/adking-2023-04-25_18:48:20-orch:cephadm-wip-adk4-testing-2023-04-25-1313-pacific-distro-default-smithi/7252324

@adk3798 adk3798 merged commit 45376a1 into ceph:pacific May 1, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants