microk8s icon indicating copy to clipboard operation
microk8s copied to clipboard

microk8s does not start after fresh install

Open mikhatanu opened this issue 11 months ago • 3 comments

Summary

microk8s cannot start after fresh install. On a similar vm (same os version (ubuntul 22.04.5 lts), same microk8s version (1.32/stable), same storage size and file system), microk8s can start successfully.

What Should Happen Instead?

microk8s start

Reproduction Steps

  1. sudo snap install microk8s --classic --channel=1.32/stable
  2. microk8s status microk8s is not running. Use microk8s inspect for a deeper inspection.
  3. microk8s inspect
Inspecting system
Inspecting Certificates
Inspecting services
  Service snap.microk8s.daemon-cluster-agent is running
  Service snap.microk8s.daemon-containerd is running
  Service snap.microk8s.daemon-kubelite is running
  Service snap.microk8s.daemon-k8s-dqlite is running
  Service snap.microk8s.daemon-apiserver-kicker 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 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 openSSL information to the final report tarball
  Copy snap list to the final report tarball
  Copy VM name (or none) to the final report tarball
  Copy current linux distribution to the final report tarball
  Copy asnycio usage and limits to the final report tarball
  Copy inotify max_user_instances and max_user_watches to the final report tarball
  Copy network configuration to the final report tarball
Inspecting kubernetes cluster
  Inspect kubernetes cluster
Inspecting dqlite
  Inspect dqlite
cp: cannot stat '/var/snap/microk8s/7537/var/kubernetes/backend/localnode.yaml': No such file or directory

Building the report tarball
  Report tarball is at /var/snap/microk8s/7537/inspection-report-20250107_155414.tar.gz
  1. Reinstall microk8s
snap remove microk8s --purge
snap install microk8s --classic --channel=1.31/stable
snap refresh microk8s --channel=1.32/stable

Problem still occur

Introspection Report

inspection-report-20250107_161102.tar.gz

Can you suggest a fix?

Are you interested in contributing with a fix?

no

mikhatanu avatar Jan 07 '25 09:01 mikhatanu

Fixed after rebooting. I don't know what makes this node needs to be rebooted when similar nodes does not need to be rebooted.

mikhatanu avatar Jan 07 '25 09:01 mikhatanu

Hi @mikhatanu,

Thank you so much for reporting your issue along-side of the report.

On the first look one error message stands out in the containerd daemon's logs:

Jan 07 15:51:02 app-mendix-beta-dcc microk8s.daemon-containerd[605041]: time="2025-01-07T15:51:02.253696862+07:00" level=error msg="failed to load cni during init, please check CRI plugin status before setting up network for pods" error="cni config load failed: no network config found in /var/snap/microk8s/7537/args/cni-network: cni plugin not initialized: failed to load cni config"

There seems to be a missing CNI config file. If the CNI is not properly initialized it can cause the api-server and other components to fail to start.

Have you been able to reproduce this issue?

louiseschmidtgen avatar Jan 08 '25 07:01 louiseschmidtgen

I was installing a microk8s on 2 VM. This happened on the second VM. The first VM installs smoothly. VM is same, with the only different is the IPs. A VM reboot fixed it.

mikhatanu avatar Jan 08 '25 13:01 mikhatanu