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/enable.py", line 43, in <module>
    enable(prog_name='microk8s enable')
  File "/snap/microk8s/2094/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/snap/microk8s/2094/usr/lib/python3/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/snap/microk8s/2094/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/microk8s/2094/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/snap/microk8s/2094/scripts/wrappers/enable.py", line 36, in enable
    enabled_addons, _ = get_status(get_available_addons(get_current_arch()), True)
  File "/snap/microk8s/2094/scripts/wrappers/status.py", line 157, in get_status
    kube_output = kubectl_get("all")
  File "/snap/microk8s/2094/scripts/wrappers/common/utils.py", line 166, in kubectl_get
    return run("kubectl", kubeconfig, "get", cmd, "--all-namespaces", die=False)
  File "/snap/microk8s/2094/scripts/wrappers/common/utils.py", line 39, in run
    result.check_returncode()
  File "/snap/microk8s/2094/usr/lib/python3.5/subprocess.py", line 659, in check_returncode
    self.stderr)
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?

Thanks!

Jose

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 127.0.0.1:16443 was refused - did you specify the right host or port?

With 1.21 works fine