1.由于标签位置错误引起的错误
--修改前
EOF
......
volumeClaimTemplates:
- metadata:
name: sspu-web-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 100Mi
storageClassName: nfs-storage-db01
EOF
执行报错:
[root@K8S1 work]# kubectl apply -f sspu-nginx-nfs5.yaml
Error from server (BadRequest): error when creating "sspu-nginx-nfs5.yaml":
StatefulSet in version "v1" cannot be handled as a StatefulSet: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'
2.修改后
--修改为这个,注意 storageClassName:
EOF
......
volumeClaimTemplates:
- metadata:
name: sspu-web-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 100Mi
storageClassName: nfs-storage-db01
EOF
主要是最后一行storageClassName 应该和resources对齐。而不是和Storage对齐。