Using a custom StorageClass

Most standard installatations on MicroK8S use OpenEBS for storage and are configured automatically. However, some installations might need a custom configuration - for example to use NAS storage.

It is possible to configure the system to use custom Kubernetes StorageClasses as follows:

Warning

You need to create your own custom StorageClass for RWX and RWO mode. Please refer to Storage Classes in the Kubernetes documentation.

You can use the ‘kloudspot init –custom-storage’ command to create a configuration file for your new system. It will ask a few questions and then create a ‘values.yaml’ file with the necessary configuration.

sjerman@k8s-single:~$ kloudspot init --custom-storage
?                                  Storage Configurations : Use custom storage class.
Use custom storage class.
?                            StorageClass for RWO storage : Name: microk8s-hostpath, Provisioner: microk8s.io/hostpath
?                            StorageClass for RWX storage : Name: microk8s-hostpath, Provisioner: microk8s.io/hostpath
Now using custom StorageClass for configuration
Initialize Kloudspot System Configuration

By default, the ingress controller will
use a self signed certificate. It is much better to
use a ‘proper’ SSL certificate.

Do you want to add ssl certificate? y/n
? Enter ssl key filepath: server.key
? Enter ssl ssl cert filepath: server.cert

Initialize Kloudspot System Configuration

First basic system information...
? DNS Hostname dibble.net
? Customer Reference steve

What features should be enabled
? Enable KloudManage No
? Enable KloudInsights No
? Enable Kloudhybrid Yes
Using ubuntu-vg for unshared volumes
Available:  Shared 32 GB, Unshared 49 GB

How much storage do you want to assign to each volume
? Stream processing elasticsearch (GB) 10
? Kloudinsights database (GB) 10
Required: Shared 0 GB, Unshared 20 GB
'/etc/kloudspot/values.yaml' created sucessfully.