Kubernetes StorageClassName:数量必须匹配正则表达式

Kubernetes StorageClassName: quantities must match the regular expression

我有以下 pv.yaml Kubernetes/Kustomization 文件:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: myapp-common-pv
  namespace: myapp
  labels:
    app.kubernetes.io/name: myapp-common-pv
    app.kubernetes.io/component: common-pv
    app.kubernetes.io/part-of: myapp
spec:
  capacity:
    storage: 30Gi
  accessModes:
  - ReadWriteMany
  nfs:
    path: /myapp_nfs_share
    server: <omitted for security purposes>
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: myapp-common-pvc
spec:
  accessModes:
  - ReadWriteMany
  storageClassName: ""
  volumeName: myapp-common-pv
  resources:
    requests:
      storage: 30gi

当我 运行 我得到:

persistentvolume/myapp-common-pv unchanged
Error from server (BadRequest): error when creating "/Users/myuser/workspace/myapp/k8s/pv": PersistentVolumeClaim in version "v1" cannot be handled as a PersistentVolumeClaim: v1.PersistentVolumeClaim.Spec: v1.PersistentVolumeClaimSpec.StorageClassName: Resources: v1.ResourceRequirements.Requests: unmarshalerDecoder: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$', error found in #10 byte of ...|ge":"30gi"}},"storag|..., bigger context ...|teMany"],"resources":{"requests":{"storage":"30gi"}},"storageClassName":"","volumeName":"myapp-common|...

以上,<omitted for security purposes> 一个有效的 IP 地址,我只是出于...安全目的删除了它。

由于 this article explaining why its necessary,我正在设置 storageClassName: ""

任何人都可以发现我的 pv.yaml 文件有什么问题吗? 以及我需要做什么(特别是!)修好了吗?

quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP][-+]?[0-9])$', error found in #10 byte of ...|ge":"30gi"}}

改变

storage: 30gi

storage: 30Gi

Gi部分必须跟在predefined units之后。