microk8s: Failed to enable dns
I’m on Arch. I was able to install snap and the microk8s snap ok. I can enable registry, but when I try to enable dns I get this.
❯ sudo microk8s.enable dns
Enabling DNS
Applying manifest
serviceaccount/coredns created
configmap/coredns created
deployment.apps/coredns created
service/kube-dns created
clusterrole.rbac.authorization.k8s.io/coredns created
clusterrolebinding.rbac.authorization.k8s.io/coredns created
Restarting kubelet
systemctl: /snap/microk8s/1247/usr/lib/x86_64-linux-gnu/libp11-kit.so.0: no version information available (required by /usr/lib/systemd/libsystemd-shared-245.so)
systemctl: symbol lookup error: /usr/lib/systemd/libsystemd-shared-245.so: undefined symbol: p11_kit_uri_get_slot_info, version LIBP11_KIT_1.0
Failed to enable dns
It looks like my systemd libs are mismatched with the libp11-kit libs in the container. I have arch’s p11-kit and libp11-kit packages both installed and up to date.
Please run microk8s.inspect and attach the generated tarball to this issue.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 31 (5 by maintainers)
The PR with the fix is merged. The snap on the edge channel should be available within the next few hours. Try it with:
The Patch should reach stable with the 1.18.3 release.
Thank you all for helping in fixing this.
OK, the problem lies here:
https://github.com/ubuntu/microk8s/blob/master/microk8s-resources/actions/common/utils.sh#L70
When microk8s is invoking
sudo, it’s modifying the linker paths to only look in its container. Previously, with versions <= 1.15 the scripts just invokedsudodirectly without any wrapper function or environment modification. You can see where it changed thekubeletrestart at the end of this file in this commit:https://github.com/ubuntu/microk8s/blob/36f79886a074167a0972a19cc14b134bef5a1bd8/microk8s-resources/actions/enable.dns.sh
So, the workaround is to simply perform these steps manually:
/var/lib/snapd/snap/microk8s/current/actions/dns.yamlto a temporary location$ARCHwith your native architecture (most likelyamd64microk8s kubectlor your ownkubectlbinary with these args:microk8s kubectl --kubeconfig=/var/snap/microk8s/current/credentials/client.config apply -f dns.yamlkubeletarguments file located at/var/snap/microk8s/current/args/kubelet, adding these lines:kubeletvia systemd:sudo systemctl restart snap.microk8s.daemon-kubelet.serviceHowever, you’ll still get
microk8s statusreporting that DNS is not enabled. I found why, but it’s 3 AM and I’ll open a bug report after some sleep.Okay, I tried the snap of the PR and the
microk8s enable dnspath seems to be working:FWIW I’m getting the same error with
microk8s enable dnson Fedora 32 with microk8s 18.9:I had to use 18.9 because the latest (19.2) wouldn’t start the node and I couldn’t figure out why. I worked around this issue in 18.9 by restarting microk8s completely (although I know I probably could have restarted just the affected service, I didn’t bother finding out the service name).
Also getting this error on arch with up-to-date libp11 packages.