<p>On attempt to deploy MongoDB to a Kubernetes cluster with MongoDB Kubernetes Operator, I am seeing the following error in persistent volumes:</p>
<pre><code>$ kubectl describe pvc data-volume-mongodb-0
(...)
  Warning  ProvisioningFailed    31s (x4 over 2m45s)   (...).com_csi-controller-0_b0e3662f-4b9e-4de5-a45b-0132ab5971a8  failed to provision volume with StorageClass &quot;tier1&quot;: created volume capacity 9663676416 less than requested capacity 10000000000.(...)
</code></pre>
<p>Is this an issue with my provider or a known Kubernetes issue?</p>

jjrz
<p>MongoDB Kubernetes Operator default data volume capacity is <code>10G</code>.</p>
<p>I was able to override it with my own PVC:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: data-volume-kompas2mongo-0
  labels:
    app: kompas2mongo-svc
spec:
  storageClassName: tier1
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
</code></pre>
<p>Deployed to my clusted with:</p>
<pre class="lang-sh prettyprint-override"><code>$ kubectl apply -f mongodb-data-pvc.yaml
</code></pre>
<p>I did the same for the logs volume:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: logs-volume-kompas2mongo-0
  labels:
    app: kompas2mongo-svc
spec:
  storageClassName: tier1
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi
</code></pre>
<p>Deployed to my clusted with:</p>
<pre class="lang-sh prettyprint-override"><code>$ kubectl apply -f mongodb-logs-pvc.yaml
</code></pre>
<p>Changing <code>10G</code> to <code>10Gi</code>, and <code>2G</code> to <code>2Gi</code> did the trick for me. After that, both volumes got provisioned correctly:</p>
<pre class="lang-sh prettyprint-override"><code>$ kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                STORAGECLASS   REASON   AGE
pvc-df6b01e9-af96-470d-af37-49c6993b70e6   10Gi       RWO            Delete           Bound    default/data-volume-kompas2mongo-0   tier1                   3h8m
pvc-f2f08105-61c4-444c-b7e0-900aa403c122   2Gi        RWO            Delete           Bound    default/logs-volume-kompas2mongo-0   tier1                   3h8m
</code></pre>
