DEV Community

Cover image for Minimalistic Kubernetes apps with Microk8s
Andrii Maliuta
Andrii Maliuta

Posted on

3 1

Minimalistic Kubernetes apps with Microk8s

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
  • Minikube
  • Kind
  • Kubeadm
  • Microk8s

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.

Installation

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:

  1. Install microk8s
    $ sudo snap install microk8s --classic --channel=1.24

  2. Configure permissions:

sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
Enter fullscreen mode Exit fullscreen mode
  1. Check for successful installation: microk8s status --wait-ready

Addons

Microk8s has a nice ecosystem of addons that help to minimize manual configuration of APIs. Full list of add-ons:
https://microk8s.io/docs/addons#heading--list

We will use:

  • microk8s enable dns - for communication with outer world
  • microk8s enable dashboard - for use of UI

That's it!

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!

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay