Tips and Tricks

Here are some tips for debugging and diagnosing issues:

Kubernetes CLI

The CLI is available.

Dashboard

The ’nicest’ way to explore the system, access logs etc is using the dashboard. You can enable an ingress for it using the following in the ‘values.yaml’ file:

debug:
  dashboard: true

And then go to https://<ip or hostname>/k8sdash/

You can get the required token using the following command:

kubectl create token default

If you just want temporary access, you can start up a proxy on a proxy port:

microk8s dashboard-proxy

The dashboard will be available on port 10443. Authenticate using the token that prints to the console.

Debug Container

Run the following command to enable:

kloudspot debug enable

A debug shell POD will be created containing useful utilities for accessing the database, Kafka etc.. You can connect to it either via the dashboard or via the CLI:

kloudspot connect <container>

Configuration Values

All of the configuration for the helm chart is set via the ‘/etc/kloudspot/values.yml’ file.

The documentation for the available values is here: Configuration Value Reference.

Since that file will gently age, you can get current values from the helm command:

defaults from helm chart:

microk8s helm3 show values kloudspot/kloudspot

values overrides being used currently:

 microk8s helm3 get  values kloudspot

all values being used currently:

 microk8s helm3 get  values --all kloudspot

Remember that you need to update the helm chart to get the ’latest’ stuff:

 microk8s helm3 repo update

Storage Configuration

LVM Volume Group Configuration

Detailed information on LVM volume group configuration is beyond the scope of these instructions. See here for a readable guide.

However, two common scenarios are as follows:

Default Ubuntu installation on a single disk.

The Ubuntu installer, by default, creates a LVM volume group occupying the whole disk and then allocates 50% of the VG or 30 GB from the group as the root directory (’/’). The free space on the disk is then available to create other volumes.

Two Disks.

If you have a separate disk allocated for LVM, you probably need to create a Volume Group. You can use the following commands to identify a disk and provision it for LVM

List available disks:

sudo lsblk -p  # find disks
NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
...
├─/dev/vda1                           252:1    0     1M  0 part
├─/dev/vda2                           252:2    0     2G  0 part /boot
└─/dev/vda3                           252:3    0    98G  0 part
  ├─/dev/mapper/ubuntu--vg-ubuntu--lv 253:0    0    49G  0 lvm  /
  └─/dev/mapper/ubuntu--vg-gluster    253:1    0    49G  0 lvm
/dev/vdb                              252:16   0   200G  0 disk
└─/dev/vdb1                           252:17   0   200G  0 part

Create an LVM Volume Group for local provisioning

sudo pvcreate /dev/vdb1
sudo vgcreate vg_data  /dev/vdb1

Logical Volume Creation

Again beyond the scope of this… but two examples:

Consume all available space in the VG:

sudo lvcreate -l 100%FREE -n cstor ubuntu-vg

Create a 20GB logical volume:

sudo lvcreate -L 20G -n cstor ubuntu-vg