# "Microk8s is not running" after reinstall

**URL:** <https://discuss.kubernetes.io/t/microk8s-is-not-running-after-reinstall/14300>\
**Category:** microk8s\
**Created:** [December 30, 2020, 3:10pm UTC](https://discuss.kubernetes.io/t/microk8s-is-not-running-after-reinstall/14300 "2020-12-30T15:10:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![littlebenlittle](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/littlebenlittle/32/6599_2.png) [@littlebenlittle](https://discuss.kubernetes.io/u/littlebenlittle)\
**Post date:** [December 30, 2020, 3:10pm UTC](https://discuss.kubernetes.io/t/microk8s-is-not-running-after-reinstall/14300/1 "2020-12-30T15:10:32Z")

</div>

I just uninstalled and reinstalled microk8s 1.20 but it doesn’t look like I was able to get everything back to a fresh state.

```
$ sudo snap remove microk8s --purge
microk8s removed
$ sudo snap install microk8s --channel=1.20 --classic
microk8s (1.20/stable) v1.20.0 from Canonical✓ installed
$ microk8s.start
Started.
$ microk8s.status
microk8s is not running. Use microk8s inspect for a deeper inspection.

```

I also tried the 1.19 channel and got the same result. My next bet is wiping the disk and starting over, but I wanted to check if I had any other options.

---

<div class="post-metadata">

**Author:** ![balchua1](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/balchua1/32/5372_2.png) [@balchua1](https://discuss.kubernetes.io/u/balchua1)\
**Post date:** [December 30, 2020, 10:04pm UTC](https://discuss.kubernetes.io/t/microk8s-is-not-running-after-reinstall/14300/2 "2020-12-30T22:04:28Z")

</div>

Hi, it takes some bit of time to get the cluster into running state. Do you have the inspect tarball that you can upload here?  
Thanks

---

<div class="post-metadata">

**Author:** ![asifansari80](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@asifansari80](https://discuss.kubernetes.io/u/asifansari80)\
**Post date:** [September 24, 2021, 3:36pm UTC](https://discuss.kubernetes.io/t/microk8s-is-not-running-after-reinstall/14300/3 "2021-09-24T15:36:08Z")

</div>

Is there any update on the issue ?  
I am also facing the same issue.

If needed i can upload the tarball.

---

<div class="post-metadata">

**Author:** ![cjohnston1158](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/cjohnston1158/32/6860_2.png) [@cjohnston1158](https://discuss.kubernetes.io/u/cjohnston1158)\
**Post date:** [June 7, 2022, 5:27pm UTC](https://discuss.kubernetes.io/t/microk8s-is-not-running-after-reinstall/14300/4 "2022-06-07T17:27:13Z")

</div>

I was seeing the same thing, and took a shot at trying to enable some addons even though microk8s status wasn’t returning that it was running. When I tried to enable the addons I got a traceback that started helping me out:

```auto
$ microk8s enable ingress metallb:10.64.140.43-10.64.140.49 rbac storage dns
Traceback (most recent call last):
  File "/snap/microk8s/3202/scripts/wrappers/enable.py", line 43, in <module>
    enable(prog_name="microk8s enable")
  File "/snap/microk8s/3202/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/microk8s/3202/usr/lib/python3/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/microk8s/3202/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/microk8s/3202/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/microk8s/3202/scripts/wrappers/enable.py", line 36, in enable
    enabled_addons, _ = get_status(get_available_addons(get_current_arch()), True)
  File "/snap/microk8s/3202/scripts/wrappers/status.py", line 157, in get_status
    kube_output = kubectl_get("all")
  File "/snap/microk8s/3202/scripts/wrappers/common/utils.py", line 169, in kubectl_get
    return run("kubectl", kubeconfig, "get", cmd, "--all-namespaces", die=False)
  File "/snap/microk8s/3202/scripts/wrappers/common/utils.py", line 39, in run
    result.check_returncode()
  File "/snap/microk8s/3202/usr/lib/python3.6/subprocess.py", line 389, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '('kubectl', '--kubeconfig=/var/snap/microk8s/3202/credentials/client.config', 'get', 'all', '--all-namespaces')' returned non-zero exit status 1.

```

I decided to run the kubectl command manually and got:

```auto
$ kubectl --kubeconfig=/var/snap/microk8s/3202/credentials/client.config get all --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system pod/calico-node-jxcdm 1/1 Running 0 13m
kube-system pod/calico-kube-controllers-f7868dd95-mx8dz 1/1 Running 0 13m

NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 13m

NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 13m

NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
kube-system deployment.apps/calico-kube-controllers 1/1 1 1 13m

NAMESPACE NAME DESIRED CURRENT READY AGE
kube-system replicaset.apps/calico-kube-controllers-f7868dd95 1 1 1 13m
Error from server (NotFound): Unable to list "autoscaling/v2, Resource=horizontalpodautoscalers": the server could not find the requested resource

```

Odd… I then tried to run the same command but using the config provided by microk8s config… This didn’t have any errors… I compared the two config files and the only difference was that /var/snap/microk8s/3202/credentials/client.config was using 127.0.0.1 where the one from microk8s config was using the machines IP… I changed client.config to use the machine IP and microk8s status started working.
