<p>I have packed the software to a container. I need to put the container to cluster by Azure Container Service. The software have outputs of an directory <code>/src/data/</code>, I want to access the content of the whole directory. </p>

<p>After searching, I have to solution.</p>

<ol>
<li>use Blob Storage on azure, but then after searching, I can't find the executable method.</li>
<li>use Persistent Volume, but all the official documentation of azure and pages I found is about Persistent Volume itself, not about how to inspect it.</li>
</ol>

<p>I need to access and manage my output directory on Azure cluster. In other words, I need a savior. </p>

<p>As I've explained <a href="https://frank.sauerburger.io/2021/12/01/inspect-k8s-pvc.html" rel="noreferrer">here</a> and <a href="https://k8s.sauerburger.com/t/pvc-inspect" rel="noreferrer">here</a>, in general, if you can interact with the cluster using <code>kubectl</code>, you can create a pod/container, mount the PVC inside, and use the container's tools to, e.g., <code>ls</code> the contents. If you need more advanced editing tools, replace the container image <code>busybox</code> with a custom one.</p>
<p><strong>Create the inspector pod</strong></p>
<pre class="lang-yaml prettyprint-override"><code>cat &lt;&lt;EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: pvc-inspector
spec:
  containers:
  - image: busybox
    name: pvc-inspector
    command: [&quot;tail&quot;]
    args: [&quot;-f&quot;, &quot;/dev/null&quot;]
    volumeMounts:
    - mountPath: /pvc
      name: pvc-mount
  volumes:
  - name: pvc-mount
    persistentVolumeClaim:
      claimName: YOUR_CLAIM_NAME_HERE
EOF
</code></pre>
<p><strong>Inspect the contents</strong></p>
<pre><code>kubectl exec -it pvc-inspector -- sh
$ ls /pvc
</code></pre>
<p><strong>Clean Up</strong></p>
<pre><code>kubectl delete pod pvc-inspector
</code></pre>
