-
Notifications
You must be signed in to change notification settings - Fork 0
How to use DirectPV without MinIO
Cesar Celis Hernandez edited this page Apr 10, 2024
·
2 revisions
To document how to use DirectPV without MinIO
- 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
- Apply the claim:
kubectl apply -f /Users/cniackz/minio/claim.yaml
- Look how DirectPV bound it:
- You have to specify the node:
volume.kubernetes.io/selected-node: minio-k8s18
otherwise will be pending state.
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
---