Quota - WiP

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
oc apply -f - <<EOF
apiVersion: v1
kind: ResourceQuota
metadata:
  name: storage
spec:
  hard:
    hostpath-provisioner.storageclass.storage.k8s.io/persistentvolumeclaims: 0
    managed-nfs-storage.storageclass.storage.k8s.io/persistentvolumeclaims: 1
EOF

$ oc describe quota/storage
Name:                                                                    storage
Namespace:                                                               cnv-demo
Resource                                                                 Used  Hard
--------                                                                 ----  ----
hostpath-provisioner.storageclass.storage.k8s.io/persistentvolumeclaims  0     0
managed-nfs-storage.storageclass.storage.k8s.io/persistentvolumeclaims   0     1
$

oc apply -f - <<EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-hostpath-provisioner
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: hostpath-provisioner
EOF

Error from server (Forbidden): error when creating "STDIN": persistentvolumeclaims "pvc-hostpath-provisioner" is forbidden: exceeded quota: storage, requested: hostpath-provisioner.storageclass.storage.k8s.io/persistentvolumeclaims=1, used: hostpath-provisioner.storageclass.storage.k8s.io/persistentvolumeclaims=0, limited: hostpath-provisioner.storageclass.storage.k8s.io/persistentvolumeclaims=0

oc apply -f - <<EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-managed-nfs-storage-1
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: managed-nfs-storage
EOF
persistentvolumeclaim/pvc-managed-nfs-storage-1 created

oc apply -f - <<EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-managed-nfs-storage-2
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: managed-nfs-storage
EOF
Error from server (Forbidden): error when creating "STDIN": persistentvolumeclaims "pvc-managed-nfs-storage-2" is forbidden: exceeded quota: storage, requested: managed-nfs-storage.storageclass.storage.k8s.io/persistentvolumeclaims=1, used: managed-nfs-storage.storageclass.storage.k8s.io/persistentvolumeclaims=1, limited: managed-nfs-storage.storageclass.storage.k8s.io/persistentvolumeclaims=1

$ oc describe quota/storage
Name:                                                                    storage
Namespace:                                                               cnv-demo
Resource                                                                 Used  Hard
--------                                                                 ----  ----
hostpath-provisioner.storageclass.storage.k8s.io/persistentvolumeclaims  0     0
managed-nfs-storage.storageclass.storage.k8s.io/persistentvolumeclaims   1     1

Last update: June 4, 2021
Back to top