When I first started to learn Kubernetes, I tries to figured out how to start quickly and with minimal efforts for bootstrap. At that time I did not find guides how to use K8s locally on own server or in VPS and not in SAAS.
So, the options to use K8s in simple way are:
- Install K8s modules (kubectl, apis, proxy, etc.) manually
Official guide of K8s tools options - https://kubernetes.io/docs/tasks/tools/
All options are good and have nice tooling, but today I will describe using microk8s (https://microk8s.io/). For me it was the simplest way to bootstrap the environment with app running in K8s.
I will describe use of K8s in Ubuntu OS, but it is easy to use it in most other OS you like.
The simplest way is to use SNAP:
$ sudo snap install microk8s --classic --channel=1.24
sudo usermod -a -G microk8s $USER sudo chown -f -R $USER ~/.kube
- Check for successful installation:
microk8s status --wait-ready
Microk8s has a nice ecosystem of addons that help to minimize manual configuration of APIs. Full list of add-ons:
We will use:
microk8s enable dns- for communication with outer world
microk8s enable dashboard- for use of UI
You can use usual kubectl commands:
microk8s kubectl get all
microk8s kubcectl get pods
Also, you can check, start and stop service:
- microk8s stop
- microk8s start
- microk8s status
Full list of commands: https://microk8s.io/docs/command-reference
Further I will write how to deploy Spring, Go or other apps in microk8s and VPS.
Thank you for reading!