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.

    curl -L <https://github.com/InfuseAI/primehub/releases/download/v3.12.3/primehub-v3.12.3.tar.gz> | tar xz
    cd primehub/install
    
  2. Run the following command to install MicroK8s.

    ./primehub-install create singlenode --k8s-version 1.21
    

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

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

    Please log in again to continue the installation. This step is required because the current user has been added to the microk8s group.

  3. After logging back in, rerun the same command to finish the single-node MicroK8s provision.

    cd primehub/install
    ./primehub-install create singlenode --k8s-version 1.21
    

Verify MicroK8s installation

  1. Use kubectl to verify the installation.

    kubectl get nodes -o wide
    NAME            STATUS   ROLES    AGE     VERSION                     INTERNAL-IP       EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
    node1           Ready    <none>   1m      v1.21.13-3+cbc10c94808907   192.168.1.1       <none>        Ubuntu 22.04.2 LTS   5.15.0-75-generic   containerd://1.4.13
    
    kubectl get pod --all-namespaces
    NAMESPACE       NAME                                                        READY   STATUS    RESTARTS   AGE
    kube-system     calico-node-xxxxx                                           1/1     Running   0          10m
    kube-system     calico-kube-controllers-f7868dd95-xxxxx                     1/1     Running   0          10m
    kube-system     hostpath-provisioner-566686b959-xxxxx                       1/1     Running   0          8m26s
    kube-system     coredns-7f9c69c78c-xxxxx                                    1/1     Running   0          8m25s
    ingress-nginx   nginx-ingress-ingress-nginx-defaultbackend-76d8bd48-xxxxx   1/1     Running   0          6m41s
    ingress-nginx   nginx-ingress-ingress-nginx-controller-5c9b868886-xxxxx     1/1     Running   0          6m41s
    
  2. Use snap to verify microk8s status.

    snap list | grep microk8s
    microk8s  v1.21.13       3410   1.21/stable    canonical**  classic
    
  3. Use microk8s to verify microk8s service status.

    microk8s status
    microk8s is running
    high-availability: no
      datastore master nodes: 127.0.0.1:19001
      datastore standby nodes: none