-
Notifications
You must be signed in to change notification settings - Fork 239
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
[BUG] crc does not start on Windows 10 due to DNS / nameserver not set succesfully #1193
Comments
The DNS server entry is correctly added to Hyper-V default switch, however in the default configuration on Windows 10 this does not have a low enough metric to make any difference. I have been able to work around this issue by doing the following:
|
This is not the issue. @code-ready/crc-devel can we make this a WARN instead?
The metric is usually not an issue. Were you connected to the VPN when you tried the initial run?
|
@gbraad no, this is used by every |
Yes, I was. I have repeated the process while disconnected with the same results
I meant the netsh command used by:
|
This early failure is problematic. Could this error be made a warning? |
seems like adding entries to the Name Resolution Policy Table (as demonstrated above) would be more similar to the way systemd-resolved handles this on Linux. could be less disruptive than modifying nameservers or hosts file |
If so, this should exit the process, as it now seems to error and continue on? Why I mention this, is that it pops up in serveral issues and it is not the actual issue (it confuses users as there is no obvious solution to this). |
Looking into this now. Thanks! basically it provides the much needed split DNS functionality. Note: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn593632(v=ws.11) is available on/since Windows 2012 R2. Will look into this for use on Win 10 Pro (commands are available, but unsure if they work as expected). |
This is due to the |
I've adapted my workaround for this based on your feedback, running these commands while 'crc start' shows:
This has the desired effect and everything is started successfully
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@praveenkumar @kevprice83 Can you have a look at this? |
@par02 please report if this helps |
Thanks @gbraad, that lets me script a workaround - much better than editing the hosts file! |
@gbraad just to let you know so far so good, executing those commands as an admin privileged user solved the issue for me. I will deploy 3scale on top of the cluster over the weekend to see how it goes, especially with creating new routes etc and will provide further feedback but so far looks like CRC on Windows 10 Home is not just a pipedream :) |
@gbraad this helped get round the issue I had deploying the cluster but it seems that the stability is not great. The cluster is running fine in general and I can navigate the consoled and deploy 3scale via the operatorHub. The 3scale applications also works okay until I begin trying to access some routes via curl. I either get a 503 service unavailable or a time out waiting for a response. I don't know how much of this is simply an openshift issue or a CRC issue. I am seeing errors in the events stream like the following:
It looks like the unstable network is causing some failures which are not enough alone to cause the cluster to fail but at least it makes certain things like monitoring etc impossible. Interestingly all the UI pages for the 3scale app seem to work very well but executing a curl request directly to one of those routes fails. |
@gbraad @praveenkumar after assigning more resources to the VM it looks like the cluster has stabilised and I am using it just fine for the moment. I would say the steps provided by @michaelburch have resolved the issue for Windows 10 Home users also :) |
The problem that I am having is when then cluster was using the Default vSwitch that was internal only and not exposed to the internet. Then digging around in issues I notice that you can name the vSwitch "crc" and it will start using that vSwitch. So that got it an external address. But then DNS configuration was failing. The above
Anyone that is struggling creating the "crc" vSwitch correctly run these commands in powershell First view the network adapters and choose the nic you want to use: Get-NetAdapter This will return the adapter names. Then set up a variable to hold the correct name, and with my machine the name adapter name is "Ethernet". $net = Get-NetAdapter -Name 'Ethernet' Then create a vSwitch using the above variable New-VMSwitch -Name "crc" -AllowManagementOS $True -NetAdapterName $net.Name I started crc, and it failed but it then got an ip address. Stopped crc and added the DNS entries by hand Replace the IP Address below with the IP Address that was assigned to the crc VM Add-DnsClientNrptRule -Namespace ".apps-crc.testing" -NameServers "172.17.35.10"
Add-DnsClientNrptRule -Namespace ".crc.testing" -NameServers "172.17.35.10 Restart crc and it should use the crc vSwitch and have the correct DNS setup. |
I tested the solution with the default switch and I end up in two scenarios: Scenario 1: crc start command fails due to dns checkcrc start command fails with message:
From the log we can see the IP given to the VM, and using @michaelburch script we can set up the DnsClientNrptRules for the domains. After that a stop and start is required to start properly the cluster:
Scenario 2: crc start finish but dns resolution fails randomlyThe domain resolution fails randomly, this can be tested trying to ping the subdomain:
So, oc login fails:
After setup the dns rules with the VM ip using the @michaelburch workaround. Now it is possible to login in the cluster directly without any restart:
|
In the meantime, we worked on a new solution for the network. It doesn't modify DNS servers and only modify the hosts file. It also removes the use of the vSwitch. The feature is still alpha but you can already try it with the latest version. Instructions are here: https://github.com/code-ready/crc/wiki/VPN-support--with-an--userland-network-stack |
General information
crc setup
before starting it (Yes/No)? YesCRC version
crc version: 1.9.0+a68b5e0 OpenShift version: 4.3.10 (embedded in binary)
CRC config
Host Operating System
Steps to reproduce
Expected
INFO Check internal and public DNS query ...
INFO Check DNS query from host ...
INFO Copying kubeconfig file to instance dir ...
Actual
INFO Check internal and public DNS query ...
INFO Check DNS query from host ...
WARN foo.apps-crc.testing resolved to [23.202.231.169 23.217.138.110] but 172.17.35.9 was expected
ERRO Failed to query DNS from host: Invalid IP for foo.apps-crc.testing
Logs
https://gist.github.com/michaelburch/b549777ee4ae8ac689838a6b6d8ae815
The text was updated successfully, but these errors were encountered: