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

Dynamic Volume Provisioning #57

Merged

Conversation

MaxFedotov
Copy link
Contributor

@MaxFedotov MaxFedotov commented May 25, 2023

This PR closes #56 and adds support for Dynamic Volume Provisioning feature.

It implements 2 methods for Controller service - CreateVolume and DeleteVolume.
As CreateVolume don't provide an ability to specify an image, which will be passed to volumeHandle field in PersistentVolume object, a custom csi.storage.k8s.io/image annotation for PersistentVolumeClaim is used to store it:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    csi.storage.k8s.io/image: docker.io/warmmetal/csi-image-test:check-fs
  name: image-pvc
  namespace: system-driver-image-csi
spec:
  accessModes:
  - ReadOnlyMany
  resources:
    requests:
      storage: 6Gi
  storageClassName: system-image
  volumeMode: Filesystem

Also, CreateVolumeRequest is lacking information about annotations set on PersistentVolumeClaim (see kubernetes-csi/external-provisioner#86), so a custom watcher is implemented, which watches and indexes PersistentVolumeClaim and is used to get this annotation value.

PR also includes Helm chart refactoring, so it complies with Recommended mechanism for deploying csi drivers.

@MaxFedotov MaxFedotov force-pushed the controler-volume-create-delete branch from d63ac62 to 045eba0 Compare May 25, 2023 11:44
@kitt1987 kitt1987 merged commit 9810c51 into warm-metal:master Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic Volume provisioning
2 participants