Error while enabling dns and storage

Hi folks!

After installing microk8s and enabling dns and storage I’m getting this error:

$ microk8s.enable dns storage
Traceback (most recent call last):
  File "/snap/microk8s/2094/scripts/wrappers/", line 43, in <module>
    enable(prog_name='microk8s enable')
  File "/snap/microk8s/2094/usr/lib/python3/dist-packages/click/", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/snap/microk8s/2094/usr/lib/python3/dist-packages/click/", line 696, in main
    rv = self.invoke(ctx)
  File "/snap/microk8s/2094/usr/lib/python3/dist-packages/click/", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/microk8s/2094/usr/lib/python3/dist-packages/click/", line 534, in invoke
    return callback(*args, **kwargs)
  File "/snap/microk8s/2094/scripts/wrappers/", line 36, in enable
    enabled_addons, _ = get_status(get_available_addons(get_current_arch()), True)
  File "/snap/microk8s/2094/scripts/wrappers/", line 157, in get_status
    kube_output = kubectl_get("all")
  File "/snap/microk8s/2094/scripts/wrappers/common/", line 166, in kubectl_get
    return run("kubectl", kubeconfig, "get", cmd, "--all-namespaces", die=False)
  File "/snap/microk8s/2094/scripts/wrappers/common/", line 39, in run
  File "/snap/microk8s/2094/usr/lib/python3.5/", line 659, in check_returncode
subprocess.CalledProcessError: Command '('kubectl', '--kubeconfig=/var/snap/microk8s/2094/credentials/client.config', 'get', 'all', '--all-namespaces')' returned non-zero exit status 1

Any ideas about why is happening?



It seems the problem is with version 1.20

$ snap info microk8s | grep installed
installed:          v1.20.5             (2094) 218MB classic

$ microk8s.kubectl get all -A
The connection to the server was refused - did you specify the right host or port?

With 1.21 works fine