"cannot connect to k8s api server" after restarting docker

Hi! I’m trying to install Charmed Kubeflow on macos according to the docs. These commands worked fine:

brew install juju
minikube start
juju add-k8s myk8s
juju bootstrap myk8s my-controller
juju add-model kubeflow

After that I read the minimal requirements for the memory, changed my memory settings and restared the Docker Desktop. Now any juju command gives the same error, e.g.:

$ juju status
ERROR cannot connect to k8s api server; try running 'juju update-k8s --client <k8s cloud name>'

juju update-k8s does not solve the issue. I tried to remove and install the juju package again, to reboot the laptop. I didn’t find any service or running process related to juju. I checked that minikube is running and my kubectl works. It means that the kube’s config contains the correct address of the kube’s API.

How to fix the issue?


Unfortunately we don’t support this kind of setup at the moment (running under Docker Desktop with Minikube). I recommend using a VM running Ubuntu 20.04 LTS on your Mac instead, and installing MicroK8s in it; then deploying Charmed Kubeflow on top.

For the Juju bug, I believe this can sometimes happen when the K8s API’s certificates are regenerated, most typically triggered by a change in the network configuration. Until this gets fixed you could work around it by assigning a static IP to the VM.


1 Like