Skip to content

How to use DirectPV without MinIO

Cesar Celis Hernandez edited this page Apr 10, 2024 · 2 revisions

Objective:

To document how to use DirectPV without MinIO

Steps:

  1. Create a claim:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: please-remove-me-cesar
  namespace: ns-3
  annotations:
    volume.beta.kubernetes.io/storage-provisioner: direct-csi-min-io
    volume.kubernetes.io/selected-node: minio-k8s18
  finalizers:
    - kubernetes.io/pvc-protection
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  storageClassName: directpv-min-io
  volumeMode: Filesystem
  1. Apply the claim:
kubectl apply -f /Users/cniackz/minio/claim.yaml
  1. Look how DirectPV bound it:
Screenshot 2023-03-22 at 9 59 02 AM

Notes:

  • You have to specify the node: volume.kubernetes.io/selected-node: minio-k8s18 otherwise will be pending state.

Plan B:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: sleep-pvc
spec:
  volumeMode: Filesystem
  storageClassName: directpv-min-io
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Ki
---
apiVersion: v1
kind: Pod
metadata:
  name: sleep-pod-2
spec:
  nodeSelector:
    pool: one
  volumes:
    - name: sleep-volume
      persistentVolumeClaim:
        claimName: sleep-pvc
  containers:
    - name: sleep-container
      image: example.org/test/sleep:v0.0.1
      volumeMounts:
        - mountPath: "/mnt"
          name: sleep-volume
---
Clone this wiki locally