MicroK8s Single-Node Deployment
This guide illustrates the steps involved in deploying the CIM Solution on microk8s distribution of Kubernetes.
Hardware Requirement
Node Role | vCPU | RAM | Storage | Minimum OS revsion | |
---|---|---|---|---|---|
1 | Master+ Worker | 8 | 16 GiB | 150 GiB mounted at / or /var | Ubuntu-20.04 LTS + |
Deployment
microk8s is currently supported for Single-Node Deployment only.
update the system to latest updates
sudo apt-get -y update
Install core and microk8s
sudo snap install core
snap install microk8s --classic --channel=1.24
if you get error like below
error: cannot install "microk8s": persistent network error: Post
https://api.snapcraft.io/v2/snaps/refresh: dial tcp: lookup api.snapcraft.io: Temporary
failure in name resolution
then try restarting the systemd-resolver by executing
systemctl restart systemd-resolved.service
Update the user permissions ( If running other than root )
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
Wait for the microk8s to bootstrap properly
microk8s status --wait-ready
Install Addons for the microk8s
Enable helm
microk8s enable helm3
Enable local-Storage
microk8s enable hostpath-storage
Enable dns
microk8s enable dns
Enable metrics-server
microk8s enable metrics-server
Enable metallb
microk8s enable metallb
when requested for the IP Range, please enter the primary IP of your System as IP-IP or IP/32 format. for example if your main IP is 192.168.2.230, you can enter 192.168.2.230-192.168.2.230 or 192.168.2.230/32,
OR
if you have an IP Range , enter the range like 192.168.2.230-192.168.2.239
You can use this command to get the IP Address ip route get $(ip route show 0.0.0.0/0 | grep -oP 'via \K\S+') | grep -oP 'src \K\S+'
( approx )
Disable the existing helm command ( if you already had deployed helm in k3s )
microk8s comes with its own helm command, so we need to disable the external helm
mv /usr/local/bin/helm{,-orig}
Microk8s commands aliases
If you had previously deployed the K3s , edit your $HOME/.bashrc
file and remove the line K3SCONFIG=/var/lib/rancher/k3s.yaml
and add these aliases
alias kubectl='microk8s kubectl'
alias k='microk8s kubectl'
alias helm='microk8s helm3'
source .bashrc
source $HOME/.bashrc
update the .kube/config with microk8s config
microk8s.kubectl config view > $HOME/.kube/config
Once ready check the status of your cluster by running
k get pods -A
Deploy the Traefik
change the directory
cd cim-solution/kubernetes
deploy the traefik helm chart
helm upgrade --install=true --wait=true --debug --namespace=traefik-ingress --create-namespace --values=external/traefik/values.yaml traefik external/traefik
You can now deploy the CIM Solution using this document Expertflow CX Deployment on Kubernetes