Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Ham
Ham

Posted on

     

Getting Cilium to work on Ubuntu Cloud Image

How to get Cilium working on Ubuntu Cloud Images Focal (20.04) or Jammy (22.04).

If you are running one of the Ubuntu Cloud Images and you are trying to install Cilium as your CNI network plugin on your Kubernetes cluster. You might have noticed that you get CrashLoopBackOff from your cilium pods when issuing akubectl get pods -n kube-system

kubectl get pods output

Upon further troubleshooting on the problem pod with akubectl logs cilium-jgcdm -n kube-system you might see the below messages.

cilium pod logs display

cilium pod logs daemon qdisk

There is a very good chance you are missing some kernel configuration options. Have a look athttps://docs.cilium.io/en/stable/operations/system_requirements/#linux-kernel for more information.

The base requirements are:

cilium required kernel options

On a Ubuntu system running 20.04, you can check your kernel configurations with:
cat /lib/modules/$(uname -r)/build/.config - Note: if you are not running as root, prependsudo before the command.

You can look for specific config options by prepending a pipe to grep:
cat /lib/modules/$(uname -r)/build/.config | grep -i config_bpf_jit.

The Fix

After checking, you will noticed that certain options are not enabled. To solve, let's replace our kernel variant with the 'generic' version. If not running as root, prependsudo.

apt update && apt install linux-generic orsudo apt update && sudo apt install linux-generic -y if not running as root.

Now let's build initramfs for the kernel. You will want to use the generic kernel version that was installed, you should see the version from the install screen. You can also check under '/boot' directory with the commandls /boot:

Note: at the time of this writing, '5.4.0-204-generic' is the installed kernel version.
update-initramfs -u -k 5.4.0-204-generic orsudo update-initramfs -u -k 5.4.0-204-generic for non-root user.

Note: If you want to remove 'linux-kvm' variant, issue
sudo apt purge linux-kvm
If you plan to keep the 'linux-kvm' kernel around, don't issue the apt purge command and move any files ending in '-kvm' in the /boot directory to a different folder.
mkdir /boot/kvm-kernel
mv /boot/*-kvm /boot/kvm-kernel/

Now, let's update grub
update-grub orsudo update-grub

Reboot the system
reboot orsudo reboot

Repeat the above steps for each of the nodes you have in the cluster.

After installing 'generic' kernel and rebooting, check your cilium pods again and they all should be running.

kubectl get pods -n kube-system -owide - the '-owide' option will show which node the pods are running on.

kubectl info with cilium pod running state

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Joined

More fromHam

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp