With regard to setting the default storage-class for the cluster, George makes a great point that the control-plane charm already has a config option called 'default-storage'
Currently this setting only applies when related to ceph-mon to select cephfs, ceph-ext4, or ceph-xfs. The default is "auto" which just sets ceph-xfs as the default if ceph is enabled.
I'd propose a refactor of the logic behind `default-storage` config option. "auto" seems farfetched -- so we should probably just let it continue to mean "ceph-xfs" since it really can't mean anything else at this point[1]
> on.config.changed.default-storage
> on.update-status
list all storage-classes in the cluster
remove default annotation from all storage-classes in the cluster
case of default-storage
if "auto":
-- add annotation to storage-class/ceph-xfs if it exists in the cluster
else:
-- add annotation to storage-class/{default-storage} if it exists in the cluster
I don't care for the poll on update-status, sadly, I know of no way for the charm to watch for external annotation changes to all the storage classes in the cluster and to react on that change.
With regard to setting the default storage-class for the cluster, George makes a great point that the control-plane charm already has a config option called 'default-storage'
Currently this setting only applies when related to ceph-mon to select cephfs, ceph-ext4, or ceph-xfs. The default is "auto" which just sets ceph-xfs as the default if ceph is enabled.
I'd propose a refactor of the logic behind `default-storage` config option. "auto" seems farfetched -- so we should probably just let it continue to mean "ceph-xfs" since it really can't mean anything else at this point[1]
[1]: https:/ /github. com/charmed- kubernetes/ cdk-addons/ blob/6510703823 03a86c7f09cfb10 48140c4a6c9b386 /cdk-addons/ apply#L121- L122
> on.config. changed. default- storage class/ceph- xfs if it exists in the cluster class/{ default- storage} if it exists in the cluster
> on.update-status
list all storage-classes in the cluster
remove default annotation from all storage-classes in the cluster
case of default-storage
if "auto":
-- add annotation to storage-
else:
-- add annotation to storage-
I don't care for the poll on update-status, sadly, I know of no way for the charm to watch for external annotation changes to all the storage classes in the cluster and to react on that change.