Skip to content

OpenEBS allocates PV higher nfs-server PV capacity #187

Open
@Humungus14

Description

@Humungus14

SC for nfs-server

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: openebs-three-replica
parameters:
  fsType: xfs
  protocol: nvmf
  repl: "3"
provisioner: io.openebs.csi-mayastor
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

Size of PV is 10Gi.

NAME               STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS            AGE
nfs-server-claim   Bound    pvc-4a719762-c751-4eb8-a487-a0430c75f1ce   10Gi       RWO            openebs-three-replica   6m3s

Create PVC for pods with RWX with higher size, than nfs-server PV size

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: nfs-claim-1
  namespace: test
spec:
  storageClassName: nfs-csi
  accessModes: [ "ReadWriteMany" ]
  resources:
    requests:
      storage: 20Gi

Create deployment and mount PV

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  namespace: test
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
        volumeMounts:
          - mountPath: "/volume"
            name: data
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: nfs-claim-1

Pods are started, size inside 10Gi

Filesystem                                                                         Size  Used Avail Use% Mounted on
nfs-server.nfs-server.svc.cluster.local:/pvc-fa3737c7-48e4-4b09-be41-e73808efb826   10G  103M  9.9G   2% /volume

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions