Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support using alternative StorageClasses with microk8s enable registry #2928

Open
mitchdenny opened this issue Feb 18, 2022 · 3 comments
Open

Support using alternative StorageClasses with microk8s enable registry #2928

mitchdenny opened this issue Feb 18, 2022 · 3 comments

Comments

@mitchdenny
Copy link

@mitchdenny mitchdenny commented Feb 18, 2022

I've been playing around with microk8s quite a bit lately and I really like how simple you've made it to get a multi-node cluster up and running. I'm running it on a 5-node RPi4 cluster and it works great. I'm using this cluster as a bit of a test bed for different ideas, one of which is reliability when nodes fail.

I'm using Longhorn to provide a distributed storage solution for volumes. I'd really like to be able to use to built-in registry with microk8s but make use of the longhorn storage provider. I was thinking it would be great to be able to have an option like this:

$ microk8s enable registry:storageclass=longhorn

When the storageclass option is specified it would override the storage class.

@ktsakalozos
Copy link
Member

@ktsakalozos ktsakalozos commented Feb 21, 2022

Hi @mitchdenny. This is a nice suggestion, thank you.

The current registry addon [1] will get its storage from the default storage class. To make sure a default storage class exists it first enables the hostpath-storage addon. We would like to rewrite (probably in python with click) the enable/disable scripts of the registry addon to add -- prefixed arguments.

[1] https://github.com/canonical/microk8s-addons/blob/main/addons/registry

@mitchdenny
Copy link
Author

@mitchdenny mitchdenny commented Feb 21, 2022

Are there some examples with other addons where you have already done this?

@ktsakalozos
Copy link
Member

@ktsakalozos ktsakalozos commented Feb 22, 2022

Have a look at the kata enable addon [1]. It should be fairly straight forward on how to pass arguments in the enable script.

As soon as you have the storage class argument you will need to read the registry.yaml and parse it as a yaml file with multiple documents. Here is an example on how we do that [3]. You will need to craft a PVC based on the storage class you got as input.

[1] https://github.com/canonical/microk8s-addons/blob/main/addons/kata/enable#L86
[2] https://github.com/canonical/microk8s-addons/blob/main/addons/registry/registry.yaml#L7
[3] https://github.com/ubuntu/microk8s/blob/master/scripts/calico/upgrade.py#L42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants