Installing the Microk8s snap couldn’t be much easier. However there are a couple of extra steps and gotchas if you want to install this in a VM on the DigitalOcean.
1 snap install microk8s --classic
You can alias the
1 | kubectl |
and
1 | helm |
commands if you don’t want to keep running
1 | microk8s.kubectl |
.
1
2 snap alias microk8s.kubectl kubectl
snap alias microk8s.helm helm
Microk8s makes it simple to enable common add-ons the ones we are enabling
are:
1
2
3
4
5
6
7
8
9
10
11
12
13
14 #
# Dashboard for a bit of a nice interface to see what's happening
#
microk8s.enable dashboard
#
# Ingress for managing domain names
#
microk8s.enable ingress
#
# Helm so we can install services from templates
#
microk8s.enable helm
When we want to get to our dashboard we can’t login over http, so we need proxy connections to our local workstation. For this we will need to install
1 | kubectl |
locally, luckily this is also available as a snap, so we can install that with a
1 | snap install kubectl |
.
To get the config for your local
1 | kubectl |
you can run another handy command
1 | microk8s.config |
this will print a config file to the terminal that you can copy the into
1 | ~/.kube/config |
then you can run
1 | kubectl |
locally.
Before you run the proxy command you can get your access token by running.
1 kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
Now we have setup
1 | kubectl |
locally you can run
1 | kubectl proxy |
to access your cluster from localhost. The URL to your dashboard will be
1 http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy
More reads
Why is ChatGPT and generative AI okay for industry but not for education?
Universal Analytics to GA4 Migration
As an agency we have decided to move all of our sites over to the new Google Analytics in one hit. This post explains how and why
Perennial Blog Posting Strategy
A blogging strategy that will save you time, increase your SEO health, make that content calendar easy to deal with and help with your sanity.