yashbhutwala / kubectl-df-pv

kubectl plugin - giving admins df (disk free) like utility for persistent volumes
Apache License 2.0
403 stars 32 forks source link

Nothing is displayed for minikube PVCs #2

Closed corneliusweig closed 4 years ago

corneliusweig commented 4 years ago

I tried to test via

minikube start
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: some-pvc
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: standard
  resources:
    requests:
      storage: 2Mi
EOF

which automatically creates a PV, see kubectl get pv:

NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                 STORAGECLASS   REASON   AGE
pvc-803939a0-13ca-11ea-b74d-0800279f5fff   2Mi        RWO            Delete           Bound    default/block-pvc     standard                2m57s

However, when running kubectl df-pv nothing is displayed.

yashbhutwala commented 4 years ago

@corneliusweig thanks for trying this out and reporting this! 😄

Right now, I'm only checking the api/v1/nodes/<node-name>/proxy/stats/summary endpoint from the apiserver, so if that endpoint is disabled (which it may be for managed k8s like gke, eks) or if the volume-provisioner is not bubbling this data up, it doesn't work.

I am trying to figure out a unified way for this to work on different flavors of k8s. Meanwhile, lemme improve the messages I print out.

yashbhutwala commented 4 years ago

Another thing to note is that currently you need a pod binded to the pvc for this plugin to pull the info (apologize, but again it's an artifact of the implementation).

Even still, I am able to repro. your issue, the problem is that minikube uses hostPath provisioning, and it doesn't bubble up the info about the pv's it provisiones (afaik)

corneliusweig commented 4 years ago

I think it would be good if you can add a list of supported platforms. If gke, eks and minikube is not supported, this affects the majority of users I guess. So it would be worth to note :-)

yashbhutwala commented 4 years ago

Sorry for the late response, I was out of office. So I just tested this on GKE and it works there 😄. For minikube, it's the default storage-provisioner being used that's the problem, I can't get to seem ceph working there, lemme try another provisioner and see if I can get it to work. I added a detailed Requirements section and Tested section in the master README.md. Hope that's helpful 😄

yashbhutwala commented 4 years ago

Thanks for taking the time to create the issue! 💯

df-pv now prints the following log message: INFO[2020-07-12T12:55:47-04:00] Either no volumes found in namespace/s: 'all' or the storage provisioner used for the volumes does not publish metrics to kubelet

Requirements](https://github.com/yashbhutwala/kubectl-df-pv#requirements) section and Tested section in the master README.md should make it clear which ones this plugin works on.