Changing Microk8s' default hostpath addon storage location

Hello everyone, This is a short guide on how to change Microk8s’ default storage path for the hostpath addon. First, ensure the addon is enabled: microk8s enable hostpath-storage Then create a new directory in which you want to store volumes created in the Microk8s instance. mkdir -p /var/microk8s-volumes Then create and apply the storage class yaml file: kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: custom-storageclass provisioner: microk8s.io/hostpath reclaimPolicy: Retain parameters: pvDir: /var/microk8s-volumes volumeBindingMode: WaitForFirstConsumer To change the default storage class for Microk8s you need to run these commands:...

August 9, 2024 · 1 min · Denis Nutiu

Working with Volumes in Microk8s

Introduction Hello 👋, In this quick tutorial 💻 we’ll explore how to use Volumes and PersistentVolumes with hostpath storage in Microk8s. We will deploy a simple nginx instance and mount a volume inside it that points to the ~/Downloads folder. Let’s get started! Note: The following image was generated with Stable Diffusion How-To You can follow along if you want to setup a quick deployment with a host path volume....

April 13, 2023 · 2 min · Denis Nuțiu

Container log monitoring on Microk8s with Loki, Grafana and Promtail

Hi 👋 This is a short tutorial describing how to monitor your Kubernetes cluster container logs using Loki stack. But why? Because it is easier to view, filter your logs in Grafana and to store them persistently in Loki rather than viewing them in a terminal. Let’s get started! Assuming you already have Microk8s installed, enable the following addons: You can enable an add-on by running microk8s enable. Ex: microk8s enable dns...

February 17, 2022 · 3 min · Denis Nuțiu