Skip to main content
Skip table of contents

MicroK8s on Linux (online mode)

Installation and setup for MicroK8s on Linux distributions.

Ubuntu

  1. Install MicroK8s:
    Open a terminal and execute the following command to install MicroK8s:

    CODE
    sudo snap install microk8s --classic --channel=1.25
    1. If snap is not installed on your system, follow the instructions here to install it.

  2. Join the MicroK8s group:
    MicroK8s creates a user group to enable seamless command execution. Add your user to this group and set the correct permissions for the .kube caching directory with:

    CODE
    sudo usermod -a -G microk8s $USER
    sudo chown -f -R $USER ~/.kube
    1. Re-login or restart your session to apply the group changes:

  3. CODE
    su - $USER
  4. Check MicroK8s status:
    Ensure MicroK8s is correctly installed and ready by checking its status:

    CODE
    microk8s status --wait-ready
  5. Enable add-ons:
    Enable essential add-ons for DCT deployment:

    CODE
    microk8s enable hostpath-storage
    microk8s enable helm
    microk8s enable dns
    microk8s enable ingress
  6. Create an alias for kubectl and helm
    Facilitate command usage with an alias for microk8s kubectl and microk8s helm

    CODE
    echo "alias kubectl='microk8s kubectl'" >> ~/.bash_aliases
    echo "alias helm='microk8s helm'" >> ~/.bash_aliases
    source ~/.bash_aliases

CentOS and Red Hat

For CentOS and Red Hat, the installation process diverges primarily due to the absence of snap by default.

  1. Enable snapd:
    First, enable the EPEL repository and install snapd:

    CODE
    sudo yum install epel-release
    sudo yum install snapd
    1. Then, start and enable snapd:

  2. CODE
    sudo systemctl enable --now snapd.socket
    1. For CentOS, you may also need to enable classic snap support by creating a symbolic link:

  3. CODE
    sudo ln -s /var/lib/snapd/snap /snap
  4. Install MicroK8s:
    With snapd enabled, you can now install MicroK8s using snap:

    CODE
    sudo snap install microk8s --classic --channel=1.25
  5. Group and permissions:
    Follow the same steps as for Ubuntu to add your user to the MicroK8s group and adjust permissions for the .kube directory.

  6. Check status and enable add-ons:
    Verify MicroK8s installation and enable the necessary add-ons as outlined in the Ubuntu section.

  7. Alias for kubectland helm
    Create and source the alias for kubectl and helm as described for Ubuntu.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.