#!/bin/bash # install microk8s sudo snap install microk8s --classic --channel=1.18/stable sudo usermod -a -G microk8s $USER sudo chown -f -R $USER ~/.kube su - $USER # test microk8s microk8s status --wait-ready microk8s inspect # test kubernetes microk8s kubectl get nodes microk8s kubectl get services # add dns, dashboard, ingress and storage to microk8s microk8s enable dns dashboard ingress storage # print default token for dashboard access token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1) kubectl -n kube-system describe secret $token # setup local execution environment sudo ln -s /snap/microk8s/current/kubectl /usr/local/bin/kubectl kubectl config view --raw > ~/.kube/config # create namespaces kubectl create -f namespace-demo.json # install helm sudo snap install helm --classic # add stable repo do helm3 helm repo add stable https://kubernetes-charts.storage.googleapis.com/ helm repo update