• Skip to primary navigation
  • Skip to main content
  • Skip to footer

AnalytIQ Limited

Design Your Future

  • Facebook
  • Google+
  • Twitter
  • Home
  • About us
  • Services
    • Web Design
    • SEO
    • Digital Marketing
    • Graphic Design
    • IT Training
      • Full stack development
      • Front-End Web Developer
      • Linux Systems Administrator
      • Linux Systems Engineer
    • IT Consultancy
  • Blog
  • Contact us

MICROK8S SETUP ON UBUNTU 22.04

You are here: Home / Linux / MICROK8S SETUP ON UBUNTU 22.04

November 28, 2022 by Amicah Maina

This is a quick and short text on how to install MICROK8S 1.19/Edge on Ubuntu 22.04. I am confident it will work on current version 1.25(At the time of writing of course). These steps will also work for other Kubernetes solutions.

These are the critical issues that I found to be recurring with microk8s and frankly other kubernetes solutions:

  1. Hostname has capital letters and underscores.
  2. IP FORWARDING error on every restart of the server. 
  3. Memory Cgroups are not enabled error.

After searching and reviewing several blogs and discussions I stumbled upon this discussion on github. Particularly this comment ultimately helped resolve my persistent issue.

I would also like to credit this blog for helping further with my understanding of the issues. You can consider this as documentation of my understanding of the issues and steps taken to sort them out. 

Here are the steps taken to solve these issues.

  • Update the system repositories using the command:
# apt update
  • Change the hostname of your server:
    • # hostnamectl set-hostname example.com
    • # echo ‘192.168.0.30 example.com’ >> /etc/hosts ::: Change for multiple nodes if you have them.
  • Load the necessary kernel modules.
    • # modprobe br_netfilter
    • # modprobe overlay
    • Add these two modules on the modules file to ensure they are loaded on reboot : /etc/modules-load.d/k8s-modules.conf 
  • Enable IP FORWARDING.
cat << EOF |  tee /etc/sysctl.d/k8s.conf

net.bridge.bridge-nf-call-ip6tables = 1

net.bridge.bridge-nf-call-iptables = 1

net.ipv4.ip_forward = 1

EOF

read values from all system directories

sysctl --system

Enable Memory Cgroups:

This was the most persistent issue I faced, in case of any issues there is an email at the bottom for you to reach out incase of any issues. NOW lets get on with it.

Add the following values to the file /etc/default/grub 

cgroup_enable=memory cgroup_memory=1 systemd.unified_cgroup_hierarchy=0

Update your grub and initramfs.  Using:

# update-initramfs -u
# update-grub

REBOOT the server at this time to ensure the changes are loaded.

  • Install Microk8s now.
    • snap install microk8s –classic –channel=1.19
    • sudo usermod -a -G microk8s $USER
    • sudo chown -f -R $USER ~/.kube
    • su – $USER
    • alias kubectl=’microk8s kubectl’
    • microk8s enable dns storage dashboard
    • microk8s stop
    • microk8s start

That’s it. It should be working now. Check the status using microk8s status

Filed Under: Linux

Footer

Social

See what we're up to by following along on social media.

Follow us on:

  • Email
  • Facebook
  • Instagram
  • LinkedIn
  • Pinterest
  • Twitter

Contact

Get directions
0752525266
info@analytiqltd.co.ke
Mo,Tu,We,Th,Fr,Sa 8:00 am – 5:00 pm

Navigation

  • Web Design
  • Home
  • SEO
  • About us
  • Digital Marketing
  • Services
    • Web Design
    • SEO
    • Digital Marketing
    • Graphic Design
    • IT Training
      • Full stack development
    • IT Consultancy
  • Graphic Design
  • IT Training
  • Full stack development
  • IT Consultancy
  • Blog
  • Contact us
  • Front-End Web Developer
  • Linux Systems Administrator
  • Linux Systems Engineer

Newsletter

Stay up to date by subscribing to our newsletter.

Copyright © 2025. Developed by AnalytIQ Limited