Installation and setup for MicroK8s on Linux distributions.
Ubuntu
-
Install MicroK8s:
Open a terminal and execute the following command to install MicroK8s:sudo snap install microk8s --classic --channel=1.25-
If Snap is not installed on your system, follow the instructions here to install it.
-
-
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.kubecaching directory with:sudo usermod -a -G microk8s $USER sudo chown -f -R $USER ~/.kube-
Re-login or restart your session to apply the group changes:
su - $USER
-
-
Check MicroK8s status:
Ensure MicroK8s is correctly installed and ready by checking its status:microk8s status --wait-ready -
Enable add-ons:
Enable essential add-ons for Hyperscale deployment:microk8s enable hostpath-storage microk8s enable helm microk8s enable dns microk8s enable ingress -
Create an alias for
kubectlandhelm
Facilitate command usage with an alias formicrok8s kubectlandmicrok8s helmecho "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.
-
Enable
snapd:
First, enable the EPEL repository and installsnapd:sudo yum install epel-release sudo yum install snapd-
Then, start and enable
snapd:sudo systemctl enable --now snapd.socket -
For CentOS, you may also need to enable classic
snapsupport by creating a symbolic link:sudo ln -s /var/lib/snapd/snap /snap
-
-
Install MicroK8s:
Withsnapdenabled, you can now install MicroK8s usingsnap:sudo snap install microk8s --classic --channel=1.25 -
Group and permissions:
Follow the same steps as for Ubuntu to add your user to the MicroK8s group and adjust permissions for the.kubedirectory. -
Check status and enable add-ons:
Verify MicroK8s installation and enable the necessary add-ons as outlined in the Ubuntu section. -
Alias for
kubectlandhelm
Create and source the alias for kubectl and helm as described for Ubuntu.