<p>While I explored yaml definitions of Kubernetes templates, I stumbled across different definitions of sizes. First I thought it's about the apiVersions but they are the same. So what is the difference there? Which are right when both are the same?</p>

<p><code>storage: 5G</code> and <code>storage: 5Gi</code></p>

<pre><code>volumeClaimTemplates:
  - metadata:
      name: mongo-persistent-storage
    spec:
      resources:
        requests:
          storage: 2Gi
</code></pre>

<p>see here in detail: 
<a href="https://github.com/cvallance/mongo-k8s-sidecar/blob/master/example/StatefulSet/mongo-statefulset.yaml" rel="noreferrer">https://github.com/cvallance/mongo-k8s-sidecar/blob/master/example/StatefulSet/mongo-statefulset.yaml</a></p>

<p>and this one:</p>

<pre><code> volumeClaimTemplates:
 - metadata:
     name: mongo-persistent-storage
   spec:
     resources:
       requests:
         storage: 5G
</code></pre>

<p>here in detail: <a href="https://github.com/openebs/openebs/blob/master/k8s/demo/mongodb/mongo-statefulset.yml" rel="noreferrer">https://github.com/openebs/openebs/blob/master/k8s/demo/mongodb/mongo-statefulset.yml</a></p>

<p>From <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/" rel="nofollow noreferrer">Kubernetes source</a>:</p>
<blockquote>
<p>Limits and requests for memory are measured in bytes. You can express
memory as a plain integer or as a fixed-point integer using one of
these suffixes: E, P, T, G, M, K. <strong>You can also use the power-of-two
equivalents</strong>: Ei, Pi, Ti, Gi, Mi, Ki. For example, the following
represent <strong>roughly</strong> the same value:</p>
<p>128974848, 129e6, 129M, 123Mi</p>
</blockquote>
<p>So those are the &quot;bibyte&quot; counterparts, like user2864740 commented.</p>
<p>A <a href="https://en.wikipedia.org/wiki/Kibibyte" rel="nofollow noreferrer">little info</a> on those orders of magnitude:</p>
<blockquote>
<p>The kibibyte was designed to replace the kilobyte in those computer
science contexts in which the term kilobyte is used to mean 1024
bytes. The interpretation of kilobyte to denote 1024 bytes,
<strong>conflicting with the SI definition of the prefix kilo (1000)</strong>, used to
be common.</p>
</blockquote>
<p>So, as you can see, 5G means 5 Gigabytes while 5Gi means 5 Gibibytes. They amount to:</p>
<ul>
<li>5 G = 5000000 KB / 5000 MB</li>
<li>5 Gi = 5368709.12 KB / 5368.70 MB</li>
</ul>
<p>Therefore, in terms of size, they are not the same.</p>
<p>But don't worry if you don't understand the differences at first read. Even Windows gets it wrong!</p>
<p><a href="https://i.stack.imgur.com/rhZvM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rhZvM.png" alt="enter image description here" /></a></p>
