sudo snap install microk8s --classic
snap alias microk8s.kubectl kubectl snap alias microk8s.helm3 helm snap alias microk8s.istioctl istioctl
OR
alias kubectl='microk8s kubectl' alias helm='microk8s helm3'
Update the .kube/config sudo microk8s config > ~/.kube/config
microk8s enable dashboard dns helm3 ingress metallb metrics-server prometheus registry storage
token=$(microk8s.kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
microk8s.kubectl -n kube-system describe secret $token
kubectl describe secrets -n ni-system kubernetes-dashboard-token-c2chm
Edit kubernetes dashboard to have the - --enable-skip-login set so the token is not required
kubectl edit deployment/kubernetes-dashboard --namespace=kube-system
and add enable-skip-login as below:
spec:
containers:
- args:
- --auto-generate-certificates
- --enable-skip-login
image: k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1
Now that we have the Kubernetes dashboard installed and we have the token ( or bypassed the need for the token ). Let's create a kubernetes ingress so we can access the dashboard. Create a ingress-dashboard.yaml yaml file
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dashboard
namespace: kube-system
annotations:
# use the shared ingress-nginx
kubernetes.io/ingress.class: public
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^(/dashboard)$ $1/ redirect;
spec:
# https://kubernetes.io/docs/concepts/services-networking/ingress/
# https://kubernetes.github.io/ingress-nginx/user-guide/tls/
rules:
- http:
paths:
- path: /dashboard(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: kubernetes-dashboard
port:
number: 443
kubectl apply -f ingress-dashboard.yaml
You should now be able to access the dashboard by going to the microk8s server ip /dashboard
http://x.x.x.x/dashboard
At this point you should have a fully working microk8s install. Follow one of the other guide to install gitea ( git ), Prometheus ( monitoring ) or Linkerd ( service mesh )