<p>I am trying to run a windows container on Azure kubernetes service, for same I need to increase <strong>conatiner</strong> disk-size which is currently 20Gb. As per Microsoft <a href="https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-storage" rel="nofollow noreferrer">official document</a>, we can increase disk-size using storage-opt.</p>
<p>Could anyone tell how we can provide same option to container as not able to find same?</p>

Anuj Nautiyal
<blockquote>
<p>Increase pod disk-size in kubernetes.</p>
</blockquote>
<p>Thanks to <code>Rick Rackow</code> for suggesting the same point.</p>
<p>You can use <code>Persistent Volumes</code> to manage storage in <code>Azure Kubernetes Service</code> and potentially increase disk space for your containers.</p>
<p>You can follow the below steps.</p>
<ol>
<li>Create <strong>Storage Class</strong> by using below <code>yaml</code> code.</li>
</ol>
<pre class="lang-yaml prettyprint-override"><code>    kind: StorageClass
    apiVersion: storage.k8s.io/v1
    metadata:
      name: azuredisk-premium-retain
    provisioner: kubernetes.io/azure-disk
    reclaimPolicy: Retain
    volumeBindingMode: WaitForFirstConsumer
    allowVolumeExpansion: true
    parameters:
      storageaccounttype: Premium_LRS
      kind: Managed
</code></pre>
<p>I created a <code>Storage Class</code> called <code>azuredisk-premium-retain</code> that uses <code>Azure Managed Disks</code> with the <code>Premium_LRS</code> storage type.</p>
<pre><code>Kubectl apply -f storage.yaml
</code></pre>
<ol start="2">
<li><strong>Create a Persistent Volume Claim</strong>: Create a PVC that requests storage from the defined Storage Class.</li>
</ol>
<pre class="lang-yaml prettyprint-override"><code>    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: azure-managed-disk-pvc
    spec:
      accessModes:
        - ReadWriteOnce
      storageClassName: azuredisk-premium-retain
      resources:
        requests:
          storage: 50Gi # Specify the required storage size here as per your requirement
</code></pre>
<p>Created <code>PVC</code> using below command.</p>
<pre><code> Kubectl apply -f pvc.yaml
</code></pre>
<ol start="3">
<li>Created <code>Pod</code> and mounted <code>PVC</code></li>
</ol>
<pre class="lang-yaml prettyprint-override"><code>    kind: Pod
    apiVersion: v1
    metadata:
      name: newpod
    spec:
      containers:
      - name: newpod
        image: nginx:latest
        volumeMounts:
        - mountPath: &quot;/mnt/azure&quot;
          name: volume
      volumes:
      - name: volume
        persistentVolumeClaim:
          claimName: azure-managed-disk-pvc
</code></pre>
<p>Created <code>Pod</code> using below command</p>
<pre><code> Kubectl apply -f pod.yaml
</code></pre>
<p><img src="https://i.imgur.com/b56b24b.png" alt="enter image description here" /></p>
<p>I created a <code>Pod</code> called <code>'newpod'</code> with a container that mounts the PVC at <code>/mnt/azure</code>. The volume is defined with the name <code>'volume',</code> and it references the <code>'pvc'</code> PVC you created earlier with a size of <code>50GB</code>.</p>
<p>If needed, you can increase the size of the PVC by updating the <code>storage</code> field in its YAML definition and then reapplying the configuration.</p>
<p>Reference :  <a href="https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-storage" rel="nofollow noreferrer">Container Storage Overview</a></p>
