【问题标题】:Unable to create Kubernetes Statefullset with PVC无法使用 PVC 创建 Kubernetes Statefulset
【发布时间】:2021-06-08 14:41:49
【问题描述】:

大家好,我正在尝试创建一个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

【问题讨论】:

  • 你的 yaml 有问题。它不可读。
  • 它在您发布的错误消息中显示:Status= Code="MaxStorageAccountsCountPerSubscriptionExceeded" Message="Subscription 0c767d4cf39 already contains 251 storage accounts in location westeurope and the maximum allowed is 250."您已达到单个订阅中存储帐户的最大数量。

标签: kubernetes azure-storage kubernetes-pvc


【解决方案1】:

正如@mmiking 在 cmets 部分中指出的那样,您已达到单个订阅中的最大存储帐户数,但位于 westeurope 位置。

你可以在Azure resource quotas documentation看到:

Azure 存储对每个区域的每个订阅有 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-26
    • 1970-01-01
    • 2019-05-24
    • 2018-12-23
    • 2019-04-10
    • 2021-02-25
    • 2020-06-11
    相关资源
    最近更新 更多