Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Missing azure file storageClass #1506

Closed
jalberto opened this issue Sep 28, 2017 · 13 comments · Fixed by #1845
Closed

Missing azure file storageClass #1506

jalberto opened this issue Sep 28, 2017 · 13 comments · Fixed by #1845
Assignees

Comments

@jalberto
Copy link

Is this a request for help?: yes


Is this an ISSUE or FEATURE REQUEST? (choose one): Issue


What version of acs-engine?: 0.7.0


Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm) k8s

What happened:

after deploymnet 3 storage accounts and 3 storageClass has been created, all of them using azure-disk non using azure-file

What you expected to happen:

an storageClass for azure-file be created too

In other hand, is az-blob recommended over az-file?

@jalberto
Copy link
Author

more context:

  apiVersion: v1                                                                                                                                                                              
  kind: Secret                                                                                                                                                                                
  metadata:                                                                                                                                                                                   
    name: azure-file-secret                                                                                                                                                                   
  type: Opaque                                                                                                                                                                                
  data:                                                                                                                                                                                       
    azurestorageaccountname: foo                                                                                                                                         
    azurestorageaccountkey: bar                                          
  ---                                                                                                                                                                                         
  kind: StorageClass                                                                                                                                                                          
  apiVersion: storage.k8s.io/v1                                                                                                                                                               
  metadata:                                                                                                                                                                                   
    name: azurefile                                                                                                                                                                           
    labels:                                                                                                                                                                                         
      kubernetes.io/cluster-service: "true"                                                                                                                                                   
  provisioner: kubernetes.io/azure-file                                                                                                                                                       
  parameters:                                                                                                                                                                                 
    skuName: Standard_LRS                                                                                                                                                                     
    location: westeurope

This actually kind of work, when using a claim it creates the volume ( I can see it in azure portal), but is never ready to use according to k8s

@jskulavik
Copy link

@lachie83: is there any specific reason that acs-engine only bootstraps azure-disk by default? Would it be a breaking change to add azure-file to the masteraddons here: acs-engine/parts/kubernetesmasteraddons-azure-storage-classes.yaml?

@lachie83
Copy link
Member

not at all. We should add it.

@lachie83 lachie83 self-assigned this Oct 14, 2017
@jalberto
Copy link
Author

jalberto commented Nov 6, 2017

is this working on?

I cannot make this work with provided configuration

@jskulavik
Copy link

@jalberto: @lachie83 self-assigned this, but we should help out and add it to a PR. It's been a few weeks. The good news is that I was able to mount azureFile to my acs-engine created cluster just now. You need to make sure you create your secret with echo -n, that your cluster is in the same data center location as your storage account, and that the secret is in place. I'll put together a gist with the steps tomorrow

@jalberto
Copy link
Author

jalberto commented Nov 7, 2017

this are the steps that worked for me:

  1. create storage account (only works with standard not premium)
  2. create a new shared in previous storage account (name is important as will be used later)
  3. create secret (in same NS as PVC) & storage class
  4. create PV with storage class name & share name
  5. create PVC with same storage class & share name

so very manual process, if I don't create PV or share in storage account, PVC stuck in pending state

@skuda
Copy link

skuda commented Nov 9, 2017

Hey @jalberto,

How did you set the share name in PVC? I am stuck in that step, I can't find any example of that, usually I only set storageclass to use, requested size and accessMode.

Thanks!

@jalberto
Copy link
Author

jalberto commented Nov 9, 2017

apiVersion: "v1"
kind: "PersistentVolume"
metadata:
  name: "staging-foo" 
  namespace: "foo"
spec:
  capacity:
    storage: "20Gi" 
  accessModes:
    - "ReadWriteMany"
  storageClassName: azurefile
  azureFile: 
    secretName: azure-file-share-secret
    shareName: staging-foo
    readOnly: false 
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: "foo-data-test"
  namespace: foo
spec:
  accessModes: [ "ReadWriteMany" ]
  volumeName: staging-foo
  storageClassName: azurefile
  resources:
    requests:
      storage: 20Gi

@skuda
Copy link

skuda commented Nov 9, 2017

Awesome, thanks!

@jalberto
Copy link
Author

jalberto commented Nov 9, 2017 via email

@andyzhangx
Copy link
Contributor

For the built-in azure file storage class, it should be as simple as enough, below two azure file storage classes would be dynamic created by searching storage account in current resource group:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: azurefile-standard
provisioner: kubernetes.io/azure-file
parameters:
  skuName: Standard_LRS
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: azurefile-premium
provisioner: kubernetes.io/azure-file
parameters:
  skuName: Premium_LRS

@andyzhangx
Copy link
Contributor

Below is the examples about how to use azure file dynamic & static provisioning:
https://github.com/andyzhangx/Demo/blob/master/linux/azurefile/

@andyzhangx
Copy link
Contributor

/assign

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants