1

I have an Ubuntu Server in my basement running MicroK8S, installed via Snap. I'm trying to create a simple pod using kubectl run that I can exec into for debugging purposes. But I keep failing.

At first, I tried this command:

kubectl run -it --rm --restart=Never busybox --image=busybox -- /bin/ash

But every time I try to run that, I get this error:

pod "busybox deleted"
pod default/busybox terminated (ContainerCannotRun)
failed to create OCI runtime control socket: stat /run/user/0/snap.microk8s: no such file or directory: unknown

Then I decided to try and run the container first, and exec into second, as two separate commands. Surprisingly, the initial pod creation actually works, a la this command:

kubectl run --image=busybox --restart=Never busybox --image=busybox --command -- tail -f /dev/null

But then when I try to exec into it using this command...

kubectl exec -it busybox -- /bin/ash

...I wind up with this error:

failed to create runc console socket: stat /run/user/0/snap.microk8s: no such file or directory: unknown
command terminated with exit code 126

Both errors only come into play once I try to connect to a running pod, and both errors reference /run/user/0/snap.microk8s. I'm not really sure what those errors mean, though. Is that a problem with my configuration? Or am I missing some dependency? Or is the hard disk corrupt? Or something else entirely? And ultimately: how can I get this working?

Mark Watney
  • 361
  • 1
  • 10
soapergem
  • 719
  • 4
  • 13
  • 29
  • I'm getting exact the same issue with a cluster that used to work. I suspect it's related to me shutting it down and starting it again. Another weird symptom I have is that DNS records like postgres-service.default.svc.cluster.local can no longer be resolved inside the cluster. – Alexandru Chirițescu Mar 14 '19 at 19:55
  • @AlexandruChirițescu I would hope that microk8s is more resilient than dying after a reboot! What do you think will fix this? A full reformat + reinstall maybe? By the way, I also [submitted this as an issue](https://github.com/ubuntu/microk8s/issues/358) on their Github – soapergem Mar 14 '19 at 20:18
  • I hope that just removing the snap and installing it again would do the trick. I am running the edge version of microk8s, so I assumed also this version could be a bit more buggy. Thanks for sharing the issue, will be interesting to see if anyone knows the cause. But most likely I will remove/install the snap and deploy all my setup again. Fingers crossed :-) – Alexandru Chirițescu Mar 14 '19 at 20:23

2 Answers2

0

Try clearing out old containers and images - this seems to be a docker (not kubernetes) issue caused by lack of space. Some docker pruning can fix that.

lazysoundsystem
  • 195
  • 1
  • 6
0

You did not provide which verion of microk8s you are using.

As you are using kubectl instead of microk8s.kubectl I assume you have created alias. I have tasted 4 last versions of microk8s 1.11 1.12 1.13 and 1.14. It seems that this issue occurs only in version 1.11. To check what version you are using currently please execute

snap info microk8s

Remove old microk8s version

sudo snap remove microk8s

and install latest version of microk8s

sudo snap install microk8s --classic --channel=1.14/stable

As additional info, if you need pod which will be in Running state for longer time, you can use nginx image instead of busybox.

microk8s.kubectl exec -ti nginx -- /bin/bash

If you are new to microk8s very helpful will be this document

PjoterS
  • 615
  • 3
  • 11