See ALS persistent volume data in Storage explorer

6/19/2018

anyone know how i can see my aks persisted volume (azurefile) data in Azure Storage Explorer or in the portal?

persisted volume is working but i can't see the raw files somehow..

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: azurefile
provisioner: kubernetes.io/azure-file
parameters:
  storageAccount: trstorage


apiVersion: v1
kind: PersistentVolume
metadata:
  name: mysql
spec:
  capacity:
    storage: 1Gi
  hostPath:
    path: "/data/mysql"
  accessModes:
  - ReadWriteMany
  storageClassName: azurefile
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mysql
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: azurefile
  resources:
    requests:
      storage: 500Mi

p.s. i know it's a bad idea to use azurefile for a database so ignore that for now.

when i look in the storage account i don't see any files, that's what i'm not understanding..

-- brianbruff
azure
kubernetes

2 Answers

7/12/2018
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: azurefile
provisioner: kubernetes.io/azure-file
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=1000
  - gid=1000  
parameters:
  skuName: Standard_LRS  
  storageAccount: gdkstore

note: storageAccount: is what's missing from MS docs currently change gdkstore to your own storage account name in the correct resource group

-- brianbruff
Source: StackOverflow

6/26/2018

For your issue, I understand that you did the persisted volume in Azure Storage for your mysql in Azure Kubenets.

First, if your mount path is right and the path that mysql will automatically create files itself. You will see files in Azure Storage Explorer or in the portal with File Share.

Second, you can check if Azure Storage File Share was mounted correctly to the mount point. You can use the command kubectl describe pod podName to check it. The resulting screenshot will like this. enter image description here

Or check it in the browser with the command az aks browse --resource-group resourceGroupName --name AKSClusterName. And the resulting screenshot will like this. enter image description here

Third, you can check the path with connecting to the AKS node. For connecting, you can follow the document SSH into Azure Kubernetes Service (AKS) cluster nodes.

I did the test and the resulting screenshots here:

See persisted Volume in the portal. enter image description here

See persisted Volume in the Microsoft Azure Storage Explorer. enter image description here

-- Charles Xu
Source: StackOverflow