k0sproject / k0s

k0s - The Zero Friction Kubernetes
https://docs.k0sproject.io
Other
3.13k stars 353 forks source link

K0S does not bundle the Snapshot Controller ? - VolumeSnapshotClass CRD not included by default #3365

Open Rohmilchkaese opened 11 months ago

Rohmilchkaese commented 11 months ago

Is your feature request related to a problem? Please describe.

Am I right, that currently there no VolumeSnapshotClass CRD installed out of the box ?

If so, I would appreciate it, if we could do so. I think, there's no reason do not so, right ?

Describe the solution you would like

Include VolumeSnapshotClass CRD

Which would basically mean to include the Snapshot Controller, right ?

Describe alternatives you've considered

Installing it myself, but wouldn't it be beneficial to include it by default ?

Additional context

I need a Volume Snapshot Class / Snapshot Controller to work with Velero Backups

juanluisvaladas commented 10 months ago

I'm not familiar with the external snapshotter but as per their documentation:

Volume Snapshot feature contains the following components:

Kubernetes Volume Snapshot CRDs Volume snapshot controller Snapshot validation webhook CSI Driver along with CSI Snapshotter sidecar

The Volume Snapshot feature depends on a volume snapshot controller and the volume snapshot CRDs. Both the volume snapshot controller and the CRDs are independent of any CSI driver. The CSI Snapshotter sidecar must run once per CSI driver. The single snapshot controller deployment works for all CSI drivers in a cluster. With leader election configured, the CSI sidecars and snapshot controller elect one leader per deployment. If deployed with two or more pods and leader election is enabled, the non-leader containers will attempt to get the lease. If the leader container dies, a non-leader will take over.

I understand that it's not just adding the CRD but all these components, which is a bit against the idea of a lightweight distribution as many of our users won't need this, also I believe not every CSI driver is compatible with this. If we decide to add this it should be probably an opt-in disabled by default, or perhaps adding it as an external extension in the docs like we do with metalLB.

twz123 commented 1 month ago

You can let k0s apply those if you put the resource files into a folder below /var/lib/k0s/manifests. When deploying k0s via k0sctl, you could reference the files in k0sctl.yaml to be uploaded, or download them via an after-apply hook directly on the controllers.