Sudo snap install microk8s --classic fails

microk8s

#1

Hi,

On a Debian Stable (version 9.7) I can’t install microk8s as I am getting the following

sudo snap install microk8s --classic
error: cannot perform the following tasks:
- Run configure hook of "microk8s" snap if present (run hook "configure": 
-----
+ '[' '!' -d /var/snap/microk8s/383/certs ']'
+ grep -e '\-\-client-ca-file=${SNAP}/certs/ca.crt' /var/snap/microk8s/383/args/kube-apiserver
grep: /var/snap/microk8s/383/args/kube-apiserver: No such file or directory
+ grep requestheader-client-ca-file /var/snap/microk8s/383/args/kube-apiserver
grep: /var/snap/microk8s/383/args/kube-apiserver: No such file or directory
+ echo 'Patching requestheader-client-ca-file argument'
Patching requestheader-client-ca-file argument
+ echo ''
/snap/microk8s/383/meta/hooks/configure: line 29: /var/snap/microk8s/383/args/kube-apiserver: No such file or directory
-----)

I followed the instructions from https://microk8s.io/#quick-start and I successfully install snapd, but I couldn’t proceed due to the above error.

The directory /var/snap was created but nothing under it.

It is my first time using snapd, so I don’t know if it is an issue with snap or with microk8s itself.
Any hints would be very much appreciated.

Thanks,
Pavlos


#2

Hi @Pavlos_Parissis,

This looks like a known issue with snapd on Debian. Have a look here https://forum.snapcraft.io/t/snapd-not-apt-installing-properly-on-debian-9/8240 . If I am not mistaken this is already addressed but the fix needs to propagate through the Debian release.

The workaround for now is to do a sudo snap install core before you sudo snap install microk8s --classic.


#3

Hello @kjackal,

The proposed workaround worked fine, thanks a lot. I read the long thread as well, thanks for sharing it.

Once again thanks a lot for your assistance,
Pavlos