aks中利用azure file创建readWriteMany属性的存储类

  运维

StorageClass

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

Standard_LRS – 标准本地冗余存储 (LRS)
Standard_GRS – 标准异地冗余存储 (GRS)
Standard_RAGRS – 标准读取访问异地冗余存储 (RA-GRS)
三者具体区别见:https://docs.microsoft.com/zh-cn/azure/storage/common/storage-redundancy

rbac

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: system:azure-cloud-provider
rules:
- apiGroups: ['']
  resources: ['secrets']
  verbs:     ['get','create']
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:azure-cloud-provider
roleRef:
  kind: ClusterRole
  apiGroup: rbac.authorization.k8s.io
  name: system:azure-cloud-provider
subjects:
- kind: ServiceAccount
  name: persistent-volume-binder
  namespace: kube-system

pvc-test

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: azurefiletest
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: azurefile
  resources:
    requests:
      storage: 5Gi

LEAVE A COMMENT

Captcha Code