Difference between revisions of "Kubectl patch pvc"
Jump to navigation
Jump to search
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{lc}} | {{lc}} | ||
+ | |||
+ | To [[increase]] size in a pvc, decrease size is not suppported: | ||
[[kubectl patch]] pvc elasticsearch-master-elasticsearch-master-0 -p '{"spec":{"resources":{"requests":{"storage":"35Gi"}}}}' | [[kubectl patch]] pvc elasticsearch-master-elasticsearch-master-0 -p '{"spec":{"resources":{"requests":{"storage":"35Gi"}}}}' | ||
persistentvolumeclaim/elasticsearch-master-elasticsearch-master-0 patched | persistentvolumeclaim/elasticsearch-master-elasticsearch-master-0 patched | ||
Line 5: | Line 7: | ||
[[kubectl patch]] pvc elasticsearch-master-elasticsearch-master-1 -p '{"spec":{"resources":{"requests":{"storage":"35Gi"}}}}' | [[kubectl patch]] pvc elasticsearch-master-elasticsearch-master-1 -p '{"spec":{"resources":{"requests":{"storage":"35Gi"}}}}' | ||
Error from server (Forbidden): persistentvolumeclaims "elasticsearch-master-elasticsearch-master-1" is forbidden: only dynamically provisioned pvc can be resized and the [[storageclass]] that provisions the pvc must support [[resize]] | Error from server (Forbidden): persistentvolumeclaims "elasticsearch-master-elasticsearch-master-1" is forbidden: only dynamically provisioned pvc can be resized and the [[storageclass]] that provisions the pvc must support [[resize]] | ||
+ | |||
+ | Solution: ensure your [[StorageClass]] has [[AllowVolumeExpansion]]: True defined. Can be modified or added without loosing data. | ||
+ | [[Minikube]] | ||
+ | kubectl -n default patch pvc data-my-mariadb-0 -p '{"spec":{"resources":{"requests":{"storage":"16Gi"}}}}' | ||
+ | Error from server (Forbidden): persistentvolumeclaims "data-my-mariadb-0" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize | ||
− | + | [[kubectl describe sc standard]]| grep AllowVolumeExpansion | |
− | + | AllowVolumeExpansion: True | |
− | |||
− | |||
+ | == Related == | ||
+ | * [[Kubernetes PVC resize: kubectl patch pvc]] | ||
+ | * <code>[[AllowVolumeExpansion]]</code> | ||
+ | * <code>[[gcloud compute disks resize]]</code> | ||
+ | * <code>[[AllowVolumeExpansion]]</code> | ||
+ | * <code>[[kubectl patch pvc]]</code> | ||
− | + | == Activities == | |
+ | * Read https://www.gooksu.com/2022/08/how-to-increase-space-for-your-elasticsearch-instances-in-k8s-on-eck/ | ||
== See also == | == See also == | ||
* {{kubectl patch}} | * {{kubectl patch}} | ||
+ | * {{K8s storage}} | ||
[[Category:K8s]] | [[Category:K8s]] |
Latest revision as of 18:51, 22 October 2023
To increase size in a pvc, decrease size is not suppported:
kubectl patch pvc elasticsearch-master-elasticsearch-master-0 -p '{"spec":{"resources":{"requests":{"storage":"35Gi"}}}}' persistentvolumeclaim/elasticsearch-master-elasticsearch-master-0 patched
kubectl patch pvc elasticsearch-master-elasticsearch-master-1 -p '{"spec":{"resources":{"requests":{"storage":"35Gi"}}}}' Error from server (Forbidden): persistentvolumeclaims "elasticsearch-master-elasticsearch-master-1" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize Solution: ensure your StorageClass has AllowVolumeExpansion: True defined. Can be modified or added without loosing data.
kubectl -n default patch pvc data-my-mariadb-0 -p '{"spec":{"resources":{"requests":{"storage":"16Gi"}}}}' Error from server (Forbidden): persistentvolumeclaims "data-my-mariadb-0" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize
kubectl describe sc standard| grep AllowVolumeExpansion AllowVolumeExpansion: True
Related[edit]
- Kubernetes PVC resize: kubectl patch pvc
AllowVolumeExpansion
gcloud compute disks resize
AllowVolumeExpansion
kubectl patch pvc
Activities[edit]
- Read https://www.gooksu.com/2022/08/how-to-increase-space-for-your-elasticsearch-instances-in-k8s-on-eck/
See also[edit]
kubectl patch [ cronjobs | svc | pv | pvc | sts | service | secret | sts elastic-operator | node | daemonset | --help ]
- Kubernetes storage, storage classes, PersistentVolume (PV), PVC, CSI,
kind: StorageClass, kind: PersistentVolumeClaim, kind: PersistentVolume
,kubectl [ get | describe | edit ] pvc
,volumeClaimTemplates:
,kubectl patch pv
,FailedMount
, Volume Expansion, Volume Cloning, snapshots, ExtraVolumes, NotTriggerScaleUp,volumePVCDataSource, AllowVolumeExpansion
, EKS storage, provisioner, Storage Capacity Tracking,VolumeBinding, VolumeClaimTemplate, storage.k8s.io
, CKA Storage, DoKC, EmptyDir, Volume populators,storageclass.kubernetes.io
Advertising: