Ubuntu
-
To install MicroK8s, open a terminal window and execute the following command:
Copysudo snap install microk8s --classic --channel=1.25
-
If snap is not installed on your system, follow the instructions here to install it.
-
-
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:Copysudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube-
Re-login or restart your session to apply the group changes:
Copysu - $USER
-
-
Check the MicroK8s status to see if its correctly installed by using:
Copymicrok8s status --wait-ready
-
Enable essential add-ons for DCT deployment:
Copymicrok8s enable hostpath-storage
microk8s enable helm
microk8s enable dns
microk8s enable ingress -
Create an alias for kubectl and helm with:
Copyecho "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 the EPEL repository and install
snapd
.Copysudo yum install epel-release
sudo yum install snapd -
With
snapd
enabled, install MicroK8s withsnap
:Copysudo snap install microk8s --classic --channel=1.25
-
Follow the same steps for Ubuntu (above) and add your user to the MicroK8s group, and adjust permissions for the
.kube
directory. -
Verify the MicroK8s installation success and enable the necessary add-ons, as outlined above.
-
Create and source the alias for
kubectl
andhelm
, as described above.