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

microk8s wont install with MacOs M1 macmini, Homebrew #4525

Open
gsiawGH opened this issue May 19, 2024 · 6 comments
Open

microk8s wont install with MacOs M1 macmini, Homebrew #4525

gsiawGH opened this issue May 19, 2024 · 6 comments

Comments

@gsiawGH
Copy link

gsiawGH commented May 19, 2024

Summary

M1 macmini, 16G ram, using homebrew to install
i've tried uninstalling multipass and microk8s, and reinstalling , and followed this

What Should Happen Instead?

using homebrew to install should work

when i get to this step: microk8s status --wait-ready
i get this error: sudo: microk8s.status: command not found
An error occurred when trying to execute 'sudo microk8s.status --wait-ready' with 'multipass': returned exit code 1.

Reproduction Steps

sw_vers
ProductName: macOS
ProductVersion: 14.3
BuildVersion: 23D56

brew uninstall microk8s
brew uninstall --cask multipass
brew install ubuntu/microk8s/microk8s
microk8s install
microk8s status --wait-ready ( get error)

multipass list
Name State IPv4 Image
microk8s-vm Running 192.168.64.4 Ubuntu 22.04 LTS

multipass stop microk8s-vm
multipass delete microk8s-vm
multipass purge
microk8s install
microk8s status --wait-ready ( get same error)

Introspection Report

sudo: microk8s.inspect: command not found
An error occurred when trying to execute 'sudo microk8s.inspect' with 'multipass': returned exit code 1.

@gsiawGH
Copy link
Author

gsiawGH commented May 19, 2024

so i deleted everything, and restarted the box

this time, when i run 'microk8s install', it actually asks for password (which it didnt before), but i get a different failure:

🍺 multipass was successfully installed!
Waiting for multipass...
Warning: the "--mem" long option is deprecated in favour of "--memory". Please update any scripts, etc.
Launched: microk8s-vm
An error occurred when trying to execute 'sudo ping -c 1 snapcraft.io' with 'multipass': returned exit code 1.

microk8s status --wait-ready
sudo: microk8s.status: command not found
An error occurred when trying to execute 'sudo microk8s.status --wait-ready' with 'multipass': returned exit code 1.

@gsiawGH
Copy link
Author

gsiawGH commented May 19, 2024

if i do these step , it installs finally.

multipass shell microk8s-vm
sudo snap install microk8s --classic --channel=1.30/stable

@gsiawGH
Copy link
Author

gsiawGH commented May 19, 2024

but then the next step doesnt work:

microk8s kubectl get nodes
E0518 20:21:20.727345 5311 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0518 20:21:20.731851 5311 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0518 20:21:20.735448 5311 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0518 20:21:20.739024 5311 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0518 20:21:20.742342 5311 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?

@gsiawGH
Copy link
Author

gsiawGH commented May 19, 2024

ok, once i followed this, i was able to continue

@gsiawGH
Copy link
Author

gsiawGH commented May 19, 2024

summary to install on M1 macmini, sonoma 14.5:

brew install ubuntu/microk8s/microk8s
microk8s install --cpu 2 --memory 4 --disk 15

  • installs multipass, needs password

MANUAL STEPS to INSTALL version 1.30 (using multipass container)

multipass shell microk8s-vm
sudo snap install microk8s --classic --channel=1.30/stable

MANUAL STEPS to create config file on M1 host: ~/.microk8s/config

Manually create the directory ( mkdir ~/.microk8s )
Grab the config from the VM environment directly ( multipass shell microk8s-vm, sudo microk8s config )
create a file ~/.microk8s/config with the contents 

microk8s status --wait-ready
microk8s kubectl get nodes
microk8s kubectl get services
microk8s kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1
microk8s kubectl delete deployment kubernetes-bootcamp

@folushooladipo
Copy link

folushooladipo commented Jun 1, 2024

Yes I also experienced this problem, especially the error of:

An error occurred when trying to execute 'sudo ping -c 1 snapcraft.io' with 'multipass': returned exit code 1.

Using @gsiawGH 's solution, here are the steps that worked for me:

# Said "yes" when the below asked for permission to install multipass. Else,
# you can do `brew install multipass microk8s`
brew install microk8s

# At this stage, running "microk8s install will fail". So instead I get a shell
# inside microk8s-vm and install microk8s
multipass shell microk8s-vm
sudo snap install microk8s --classic
sudo microk8s status --wait-ready
# Within the shell, confirm that microk8s is indeed running a cluster.
sudo microk8s kubectl get nodes
# Lastly within the shell, enable the dashboard
sudo microk8s enable dashboard

# Log out of the shell and back into the host system
exit

# Then configure your host's kubectl to show the 
multipass exec microk8s-vm -- sudo microk8s config > ~/kubeconfig
# Now you can run kubectl without involving microk8s from with a shell in microk8s-vm
kubectl get nodes

# Access the dashboard. This command will show you a token that you'll use to login.
microk8s dashboard-proxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants