MicroK8s is a low-ops, minimal production Kubernetes for devs, cloud, clusters, workstations, edge, and IoT.

In this section, you will install and verify a MicroK8s installation.

Install MicroK8s

PrimeHub provides an easy installation script to install MicroK8s.

  1. Download the script primehub-install from Github.

    git clone <https://github.com/InfuseAI/primehub.git>
    
  2. Run the following command to install MicroK8s.

    Default k8s version: 1.24 Support k8s version: 1.21~1.26

    ./primehub/install/primehub-install create singlenode --k8s-version (1.21~1.26)
    

    After the first execution, you will see the following message.

    [Require Action] Please relogin this session and run create singlenode again
    

    Please run the following command line to continue the installation. This step is required because the user need to be added to the microk8s group.

    sudo usermod -a -G microk8s $USER
    newgrp microk8s
    

    Check if the user has joined the microk8s group:

    id
    uid=1000(ubuntu) gid=1001(microk8s) groups=1001(microk8s).....
    
  3. After logging back in, rerun the same command to finish the single-node MicroK8s provision.

    ./primehub/install/primehub-install create singlenode --k8s-version (1.21~1.26)
    
  4. When you see the following message, then you have install microk8s service on your server successfully.

    [Completed] Create Single Node K8S
    

Verify MicroK8s installation

  1. Use the following command line to check the status.

    ./primehub/install/primehub-install status singlenode
    

    → You will get the result:

    [K8S] Free Disk Space
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/root        29G  4.6G   25G  16% /
    [K8S] Node Status
    NAME               STATUS   ROLES    AGE    VERSION                     INTERNAL-IP     EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION    CONTAINER-RUNTIME
    ip-172-31-18-202   Ready    <none>   3m6s   v1.24.12-2+36e803be0d732b   172.31.18.202   <none>        Ubuntu 20.04.5 LTS   5.15.0-1028-aws   containerd://1.5.13
    [StorageClass] Storage Class
    NAME                          PROVISIONER            RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
    microk8s-hostpath (default)   microk8s.io/hostpath   Delete          WaitForFirstConsumer   false                  2m24s
    [Helm] Helm list
    NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
    nginx-ingress   ingress-nginx   1               2023-03-24 03:53:13.165344921 +0000 UTC deployed        ingress-nginx-4.2.5     1.3.1