kubernetes-retired / external-storage

[EOL] External storage plugins, provisioners, and helper libraries
Apache License 2.0
2.7k stars 1.6k forks source link

nfs provisioner validateOptions fails with 8.0EB available space #1298

Closed frdeng closed 4 years ago

frdeng commented 4 years ago

Got this when provisioning a 10MB PVC from nfs-provisioner

E0316 22:21:18.077195 1 controller.go:908] error syncing claim "3fa09205-67d2-11ea-a112-020017027037": failed to provision volume with StorageClass "my-nfs": error validating options for volume: insufficient available space -9223372036854775808 bytes to satisfy claim for 10485760 bytes

The nfs provisioner storage class is created from an nfs share which is 8.0EB

$ kubectl exec -it nfs-provisioner-86b866b5b7-dsbx2 -- /bin/sh
sh-5.0# df -h /export/
Filesystem       Size  Used Avail Use% Mounted on
10.0.10.37:/pv3  8.0E     0  8.0E   0% /export
sh-5.0# df /export/
Filesystem             1K-blocks  Used        Available Use% Mounted on
10.0.10.37:/pv3 9007199254740992     0 9007199254740992   0% /export
frdeng commented 4 years ago

See https://github.com/kubernetes-incubator/external-storage/blob/6d12fa04129009d161595b614fab991f8c9536c2/nfs/pkg/volume/provision.go#L348

fejta-bot commented 4 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

downvoteit commented 4 years ago

Can confirm, have experienced the same problem of incorrect available space check firing on line 348.

It does allow to create 3gb pvc but fails on >4gb.

Seems like available space is misreported.

available := int64(stat.Bavail) * int64(stat.Bsize)

root@node1:~/test# df -h /mnt
Filesystem                         Size  Used Avail Use% Mounted on
192.168.1.200:/srv/nfs/kubernetes   25G  3.3G   21G  15% /mnt
root@node1:~/test# 

Warning ProvisioningFailed 7m4s cluster.local/nfs-server-provisioner_nfs-server-provisioner-0_14314456-9e8c-455f-87eb-6ae0f24802ba failed to provision volume with StorageClass "nfs": error validating options for volume: insufficient available space 3494146048 bytes to satisfy claim for 4294967296 bytes

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: nfs1
spec:
  storageClassName: nfs
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 4Gi
wongma7 commented 4 years ago

Yes, need a fix like https://github.com/kubernetes/kubernetes/pull/90907 to always compare using resource.Quantities types, never int/int64

wongma7 commented 4 years ago

Given that there is no enforcement of resource requests anyway, the workaround could be to set resources.requests.storage to whatever nonsense value helps to pass this check.

fejta-bot commented 4 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten

nikhita commented 4 years ago

Thanks for reporting the issue!

This repo is no longer being maintained and we are in the process of archiving this repo. Please see https://github.com/kubernetes/org/issues/1563 for more details.

If your issue relates to nfs provisioners, please create a new issue in https://github.com/kubernetes-sigs/nfs-ganesha-server-and-external-provisioner or https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner.

Going to close this issue in order to archive this repo. Apologies for the churn and thanks for your patience! :pray: