问题描述
大家好,我正在尝试创建一个 StatefulSet
,它具有 PVC 和 StorageClass 作为 Azurefileshare。
当我创建这个时,我的 PVC 处于待处理状态:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning ProvisioningFailed 51m persistentvolume-controller Failed to provision volume with StorageClass "azurefile-standard-zrs2": Could not get storage key for storage account : Failed to create storage account f38f8ede8e,error: storage.AccountsClient#Create: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="MaxStorageAccountsCountPerSubscriptionExceeded" Message="Subscription 0c767d4cf39 already contains 251 storage accounts in location westeurope and the maximum allowed is 250."
这是我的清单文件:
apiVersion: apps/v1
kind: StatefulSet
Metadata:
name: Nginx-deployment2
namespace: test
spec:
replicas: 1
selector:
matchLabels:
app: backup
serviceName: <SERVICE_NAME>
template:
Metadata:
labels:
app: backup
annotations:
backup.velero.io/backup-volumes: nginx-logs
spec:
volumes:
- name: nginx-logs1
persistentVolumeClaim:
claimName: nginx-logs1
containers:
- image: base-debian:latest
resources:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "100Mi"
cpu: "200m"
name: Nginx
ports:
- containerPort: 80
volumeMounts:
- mountPath: "/var/log/Nginx"
name: nginx-logs1
readOnly: false
---
kind: PersistentVolumeClaim
apiVersion: v1
Metadata:
name: nginx-logs1
namespace: test
labels:
app: backup
spec:
accessModes:
- ReadWriteOnce
storageClassName: azurefile-standard-zrs2
resources:
requests:
storage: 1Gi
解决方法
正如@mmiking 在评论部分指出的那样,您已达到单个订阅中存储帐户的最大数量,但仅在 westeurope
位置。
您可以在Azure resource quotas documentation中看到:
Azure Storage 的每个订阅限制为每个区域 250 个存储帐户。此限制包括标准和高级存储帐户。
注意:此限制是针对每个订阅的每个区域。您可以在一个区域(例如 westeurope
)创建 250 个存储帐户,并且您仍然可以使用相同订阅在不同区域(例如 northeurope
)创建另外 250 个存储帐户。
您可以使用 az storage account show-usage 命令查看特定位置的当前存储帐户使用情况:
$ az storage account show-usage --location <LOCATION_NAME> --out table --subscription <SUBSCRIPTION_ID>
CurrentValue Limit Unit
-------------- ------- ------
9 250 Count