microk8s: MacOS: Microk8s failing to enable kubeflow
Hi there,
Right after a fresh install of MicroK8s, enable kubeflow fails
==> /usr/local/Cellar/microk8s/2.0.1/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/microk8s--wheel-20201123-5266-1tpceaz/wheel-0.34.2
==> /usr/local/Cellar/microk8s/2.0.1/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/microk8s-20201123-5266-1quxj6/microk8s-installer-v2.0.1/installer
šŗ /usr/local/Cellar/microk8s/2.0.1: 1,460 files, 13.9MB, built in 31 seconds
ddurand@macbook049 ~ % microk8s enable kubeflow
This command can't be run as root.
Try `microk8s enable kubeflow` instead.
Failed to enable kubeflow
An error occurred when trying to execute 'sudo microk8s.enable kubeflow' with 'multipass': returned exit code 1.
ddurand@macbook049 ~ %
IIRC, when I enable kubeflow on Ubuntu I can do it with sudo otherwise I get a similar failure. It requires to be executed under a standard user. Maybe something similar here ?
Didier
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 19 (2 by maintainers)
Hi @didier-durand,
You are right, this is a bug. The kubeflow addon expects the user to be in the
microk8sgroup or it will fail withThis command can't be run as root.. Themicrok8sOS native client executes allmicrok8scommands as root with sudo.Here is a workaround, get a shell in the microk8s VM:
Enable kubeflow by adding the user to the microk8s group:
Restart the VM. Get a new shell and enable kubeflow:
still not work
@ktsakalozos
I got the following result when I tried the workaround suggested. I use a macOS Big Sur version 11.1
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 4.15.0-130-generic x86_64)
System information disabled due to load higher than 2.0
Introducing self-healing high availability clusters in MicroK8s. Simple, hardened, Kubernetes for production, from RaspberryPi to DC.
https://microk8s.io/high-availability
0 updates can be installed immediately. 0 of these updates are security updates.
Last login: Thu Jan 14 12:26:42 2021 from 192.168.64.1 ubuntu@microk8s-vm:~$ sudo usermod -a -G microk8s $USER"
@saulide - thereās a typo in the original command -
kubelfowinstead ofkubeflow. Thatās the error you are seeing -Nothing to do for kubelfowFor me, the workaround works only partially well. There comes a tail with it. For example, you need to set the right permissions for some files when calling microk8s from the outside of the vm (e.g. /var/snap/microk8s/1864/juju/share/juju/controllers.yaml) again and again. Iām looking forward to the patch. However, for me it seems not that trivial, since there was a commit to especially avoid enabling kubeflow as root.
Apparently, this issue appears on Windows 10 (at least Build 19042 with multipass 1.5.0-win64) as well. So this is not only a MacOS related issue.