Closed jcayzac closed 10 months ago
Hey @jcayzac, sorry you're experiencing this issue. It's likely one of these https://multipass.run/docs/troubleshooting-networking-on-macos
Can you try to do:
microk8s uninstall
microk8s install
to see if you still get the ping error?
Thanks, Joe
Microk8s multipass works on Catalina. However, instead of microk8s.enable
it needs to be microk8s enable
.
A few features that doesn't work are enabling Kubeflow and there seems to be issues installing helm charts.
@joedborg the uninstall command thanked me for using microk8s and the subsequent install command failed again with the same error.
Microk8s multipass works on Catalina. However, instead of
microk8s.enable
it needs to bemicrok8s enable
. A few features that doesn't work are enabling Kubeflow and there seems to be issues installing helm charts.
Hey @vinhdiesal, can you let me know where you're seeing microk8s.enable
so I can fix it, please?
@joedborg the uninstall command thanked me for using microk8s and the subsequent install command failed again with the same error.
@jcayzac Thanks for trying. The quick option would be to use Virtualbox. If you already have it installed, you can run sudo multipass set local.driver=virtualbox
. Otherwise, did you manage to go over the debugging steps in the docs I linked above?
Hi @joedborg
On the MAC OSx version of the microk8s, it doesn't take any commands with a period, for example microk8s.enable
and microk8s.kubectl
will result in an error no matter what comes after it, instead you have to specify microk8s enable
and microk8s kubectl
. I was able to enable dns, dashboard, ingress, istio, fluentd, storage, metallb, etc.
What I had a hard time with is the microk8s enable kubeflow
because it always complained about the juju controller
and installing helm charts
results in network connectivity problems. The microk8s works really well as a host.
The network bridge
works well as well as long as you follow enable virtual box
as the driver and enter in a few commands from the multipass.run
website docs section.
In the mean time, I find the best solution for using microk8s on a MAC is using Parallels with Ubuntu 20.04. My mac is performing really well as the Kubernetes
host with multiple machines connecting in the cluster. Everything works including Kubeflow.
Hi @vinhdiesal
We're aware that, if you're used to using the period separator for commands, using the space separator can be confusing. However, we do believe all of our documentation is up-to-date; showing the space separator. If you spot any that isn't, please let us know.
I had the same problem (ping: snapcraft.io: Temporary failure in name resolution
). It was caused by dnsmasq already running. After uninstalling it via brew and stopping the process (sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
), microk8s install
worked without errors.
@joedborg
@jcayzac Thanks for trying. The quick option would be to use Virtualbox. If you already have it installed, you can run sudo multipass set local.driver=virtualbox. Otherwise, did you manage to go over the debugging steps in the docs I linked above?
I had the same problem with multipass. Virtualbox did the trick for me for a quick fix. Installed from here. Then ran sudo multipass set local.driver=virtualbox
.
I still have this problem on MacOS Big Sur when local.driver=hyperkit
.
Note: Further debugging has revealed that the culprit is the usual Cisco Anyconnect installing a DNS proxy system extension in Big Sur
Seems to be caused by dnsmasq. Patched it with this change to /usr/local/Cellar/microk8s/2.1.0/libexec/lib/python3.9/site-packages/vm_providers/_base_provider.py
+ self.run("sed -i -e s/^#DNS=.*/DNS=8.8.8.8/ /etc/systemd/resolved.conf".split(), hide_output=True)
+ self.run("systemctl restart systemd-resolved.service".split(), hide_output=True)
self.run("ping -c 1 snapcraft.io".split(), hide_output=True)
Seems to be caused by dnsmasq. Patched it with this change to /usr/local/Cellar/microk8s/2.1.0/libexec/lib/python3.9/site-packages/vm_providers/_base_provider.py
+ self.run("sed -i -e s/^#DNS=.*/DNS=8.8.8.8/ /etc/systemd/resolved.conf".split(), hide_output=True) + self.run("systemctl restart systemd-resolved.service".split(), hide_output=True) self.run("ping -c 1 snapcraft.io".split(), hide_output=True)
This fix no longer works, as the ping itself may fail on some MacOS situations. Instead, it's better to test connectivity in a different way, for example:
+ self.run("sed -i -e s/^#DNS=.*/DNS=8.8.8.8/ /etc/systemd/resolved.conf".split(), hide_output=True)
+ self.run("systemctl restart systemd-resolved.service".split(), hide_output=True)
+ self.run("nslookup snapcraft.io".split(), hide_output=True)
- self.run("ping -c 1 snapcraft.io".split(), hide_output=True)
Created pull request #2823
FWIW - Root cause of this issue seems to be the Ubuntu image for microk8s doesn't actually have the microk8s snap installed.
It's kind of weak nobody from Canonical figured this out for 2 years.
Hi @tdsanchez
The microk8s snap installation inside the VM is (supposed to be) performed by the installer itself, and it looks like this is failing under some conditions.
The installer downloads an image that should have microk8s installed but instead it's just a regular Multipass VM with snap and nothing else installed.
I am on MacOS Monterey 12.6 - and can't get microk8s up and running -- having similar but slightly different issues from what I can see above ..
Here is a set of error messages I am seeing -- ` …/play/microk8s  microk8s install  ✔  10078  11:28:48 Launched: microk8s-vm An error occurred when trying to execute 'sudo ping -c 1 snapcraft.io' with 'multipass': returned exit code 1. …/play/microk8s  multipass exec microk8s-vm -- sudo ping -c 1 snapcraft.io  2 ↵  10079  11:29:59 PING snapcraft.io (198.18.2.5) 56(84) bytes of data.
--- snapcraft.io ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms
…/play/microk8s  multipass exec microk8s-vm -- sudo ping -c 1 1.1.1.1  1 ↵  10080  11:30:25 PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data. 64 bytes from 1.1.1.1: icmp_seq=1 ttl=54 time=95.2 ms
--- 1.1.1.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 95.214/95.214/95.214/0.000 ms …/play/microk8s  microk8s status --wait-ready  ✔  10081  11:30:34 sudo: microk8s.status: command not found An error occurred when trying to execute 'sudo microk8s.status --wait-ready' with 'multipass': returned exit code 1.`
I am not sure it's DNS resolution since snapcraft.io resolves to 198.18.2.5 but that just sits there .. which appears to resolve to localhost (?) via this netstat .. which means something is supposed to be running on this address?? I am pretty much a total newbie on microk8s and snap and multipass ..
This was a pure vanilla install via brew install ubuntu/microk8s/microk8s
Any help and direction would be greatly appreciated ..
TIA!
The installer downloads an image that should have microk8s installed but instead it's just a regular Multipass VM with snap and nothing else installed.
This is partly true and partly false. A stock ubuntu VM is launched, and the installer then sets up MicroK8s by installing the snap
…/play/microk8s  microk8s status --wait-ready  heavy_check_mark  10081  11:30:34 sudo: microk8s.status: command not found
@sjmcdowall it appears that for some reason the installation failed. could you clean up and retry with:
# remove old vm
multipass delete microk8s-vm
multipass purge
# reinstall
microk8s install
Thanks!
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.
None of the commands provided for setting micro8s up or for reporting issues work on Catalina: