Firstly, install Kubernetes and snapd package.
sudo apt install kubernetes snapd
Get an error as a screenshot below.
Enter “sudo rm /etc/apt/preferences.d/nosnap.pref”
sudo apt-get update
sudo apt-get install
Run the command above again.
Next, install Kurbenetes.
kubernetes install
+ Create our first app deployment using nginx.
microk8s.kubectl create deployment nginx --image nginx
+ Add your user to the microk8s admin group.
+ View all running services.
microk8s.kubectl get all
+ Enable Dashboard.
microk8s.enable dns dashboard
+ List all namespaces in microk8s. Take note of the IP address of the Kubernetes dashboard.
microk8s.kubectl get all –all-namespaces
Kubernetes has created a couple of new network interfaces.
+ View token.
token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
microk8s kubectl -n kube-system describe secret $token
+ Access to Kubernetes dashboard https://10.152.183.198, and enter the token on the previous step.