crc-org / crc

CRC is a tool to help you run containers. It manages a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes
https://crc.dev
Apache License 2.0
1.26k stars 242 forks source link

Add host.crc.testing to /etc/hosts #4410

Open bobbygryzynger opened 1 month ago

bobbygryzynger commented 1 month ago

Related to #4398: because the host can be reached at host.crc.testing this should be added to CRC's /etc/hosts modifications.

127.0.0.1    host.crc.testing
cfergeau commented 1 month ago

It is similar to this docker feature https://docs.docker.com/desktop/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host, I'm not sure this also can be resolved on the host? However, this should be relatively easy to do in our case, so why not.

praveenkumar commented 1 month ago

host.crc.testing this should be added to CRC's /etc/hosts modifications.

@bobbygryzynger if host.crc.testing already available to consume in the CRC VM then why we need to modify /etc/hosts to have this entry?

bobbygryzynger commented 1 month ago

@praveenkumar I have some scripts that run both on the host and within containers on the cluster that interact with host services. It would be convenient to be able to use the same hostname in both circumstances and not have to set the value in the host's /etc/hosts myself. This would also help other developers setting up my project locally, by removing a manual step.

rohanKanojia commented 2 days ago

Can I work on this issue?