only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize

1 개요[ | ]

only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize
동적으로 프로비저닝된 pvc만 크기를 조정할 수 있고 pvc를 프로비저닝하는 스토리지 클래스가 크기조정을 지원해야 한다
# kubectl get sc standard
NAME                 PROVISIONER                RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
standard (default)   k8s.io/minikube-hostpath   Delete          Immediate           false                  28d
→ k8s.io/minikube-hostpath가 제공하는 standard 스토리지클래스는 볼륨확장을 지원하지 않는다.
# kubectl apply -f pvc.yaml
persistentvolumeclaim/mypvc created
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: mypvc
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      #storage: 1Gi
      storage: 2Gi
  storageClassName: standard
# kubectl apply -f pvc.yaml
Error from server (Forbidden): error when applying patch:
{"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"PersistentVolumeClaim\",\"metadata\":{\"annotations\":{},\"name\":\"mypvc\",\"namespace\":\"default\"},\"spec\":{\"accessModes\":[\"ReadWriteOnce\"],\"resources\":{\"requests\":{\"storage\":\"2Gi\"}},\"storageClassName\":\"standard\"}}\n"}},"spec":{"resources":{"requests":{"storage":"2Gi"}}}}
to:
Resource: "/v1, Resource=persistentvolumeclaims", GroupVersionKind: "/v1, Kind=PersistentVolumeClaim"
Name: "mypvc", Namespace: "default"
for: "pvc.yaml": persistentvolumeclaims "mypvc" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}