I installed microk8s in a LXD container
snap install microk8s --classic
When I inspect the instance it shows that snap.microk8s.daemon-proxy is not running
root@mk8s1:~# microk8s inspect
Inspecting Certificates
Inspecting services
Service snap.microk8s.daemon-cluster-agent is running
Service snap.microk8s.daemon-containerd is running
Service snap.microk8s.daemon-apiserver is running
Service snap.microk8s.daemon-apiserver-kicker is running
FAIL: Service snap.microk8s.daemon-proxy is not running
For more details look at: sudo journalctl -u snap.microk8s.daemon-proxy
Service snap.microk8s.daemon-kubelet is running
Service snap.microk8s.daemon-scheduler is running
Service snap.microk8s.daemon-controller-manager is running
Copy service arguments to the final report tarball
Inspecting AppArmor configuration
Gathering system information
Copy processes list to the final report tarball
Copy snap list to the final report tarball
Copy VM name (or none) to the final report tarball
Copy disk usage information to the final report tarball
Copy memory usage information to the final report tarball
Copy server uptime to the final report tarball
Copy current linux distribution to the final report tarball
Copy openSSL information to the final report tarball
Copy network configuration to the final report tarball
Inspecting kubernetes cluster
Inspect kubernetes cluster
Building the report tarball
Report tarball is at /var/snap/microk8s/1769/inspection-report-20201110_051804.tar.gz
root@mk8s1:~#
How should I setup microk8s in LXD container? This is what I did. Create a profile
lxc profile copy default microk8s
cat microk8s.profile | lxc profile edit microk8s
The profile is as follows
name: microk8s
config:
boot.autostart: "true"
linux.kernel_modules: ip_vs,ip_vs_rr,ip_vs_wrr,ip_vs_sh,ip_tables,ip6_tables,netlink_diag,nf_nat,overlay,br_netfilter
raw.lxc: |
lxc.apparmor.profile=unconfined
lxc.mount.auto=proc:rw sys:rw cgroup:rw
lxc.cgroup.devices.allow=a
lxc.cap.drop=
security.nesting: "true"
security.privileged: "true"
description: ""
devices:
aadisable:
path: /sys/module/nf_conntrack/parameters/hashsize
source: /sys/module/nf_conntrack/parameters/hashsize
type: disk
aadisable1:
path: /sys/module/apparmor/parameters/enabled
source: /dev/null
type: disk
aadisable2:
path: /dev/kmsg
source: /dev/kmsg
type: disk
Launch a container mk8s1
lxc launch -p default -p microk8s ubuntu:18.04 mk8s1
In the container run
apt update && apt dist-upgrade -y && apt install squashfuse -y
snap install microk8s --classic
What am I missing here?
OK. Found a solution for this problem in LXC that works for me
https://github.com/ubuntu/microk8s/issues/1438
Try adding
--conntrack-max-per-core=0
in/var/snap/microk8s/current/args/kube-proxy
and restarting microk8s