apt-get install snapd
snap install microk8s --classic --channel=1.18/stable
microk8s enable dns dashboard registry helm3 ingress storage
Dashboard URL (change IP address): https://116.203.232.90:16443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#/statefulset?namespace=default
Obtain user and password from cat /var/snap/microk8s/current/credentials/basic_auth.csv
Bearer Token for Dashboard itself:
token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
microk8s kubectl -n kube-system describe secret $token
mkdir /etc/microk8s
microk8s.config > /etc/microk8s/microk8s.conf
Download the file /etc/microk8s/microk8s.conf
to $HOME/.kube/config-m8s
(or any other filename).
Tell the kubectl
command to read the additional config file via export KUBECONFIG=$HOME/.kube/config:$HOME/.kube/config-m8s
(this ENV variable defines a list of config files that kubectl
will use). Add this to your .bashrc
or similar to make it permanent.
Switch to the cluster context
kubectl config use-context microk8s
kubectl get all --all-namespaces
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.14.1/cert-manager.yaml
kubectl create namespace cert-manager
helm repo add jetstack https://charts.jetstack.io
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--version v0.14.1