Welcome to the Linux Foundation Forum!

Exercise 8.4 creation PVC with the same name two times increases Used storagequota

While doing Exercise 8.4 for a ResourceQuota, I've created two times a PVC from the same configuration file. The first creation was successful and the second one shows an error as expected:
Error from server (AlreadyExists): error when creating "pvc.yaml": persistentvolumeclaims "pvc-one" already exists

However, I noticed that Resource Quotas in small ns for Used column increased:

ubuntu@k8smaster:~$ kubectl describe ns small
Name: small
Labels: kubernetes.io/metadata.name=small
Annotations:
Status: Active

Resource Quotas
Name: storagequota
Resource Used Hard
-------- --- ---
persistentvolumeclaims 2 10
requests.storage 400Mi 500Mi

pvc and pv looked well. I wonder is it a bug or normal?
Why it does increase even though reject creation the pvc with the same name?

2) I tried to create pvc again(third time) and received the error for limitation of the requests.storage:

Error from server (Forbidden): error when creating "pvc.yaml": persistentvolumeclaims "pvc-one" is forbidden: exceeded quota: storagequota, requested: requests.storage=200Mi, used: requests.storage=400Mi, limited: requests.storage=500Mi

And pvc went to Pending status
ubuntu@k8smaster:~$ kubectl get pvc -n small
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
pvc-one Pending 11m

Comments

  • artem37iv
    artem37iv Posts: 5
    edited September 2022

    After some time Resource Quotas returned to the first value without any actions from me. How does it work?

Categories

Upcoming Training