|
| 1 | +# |
| 2 | +# Author: Hari Sekhon |
| 3 | +# Date: 2024-12-03 19:03:03 +0700 (Tue, 03 Dec 2024) |
| 4 | +# |
| 5 | +# vim:ts=2:sts=2:sw=2:et |
| 6 | +# lint: k8s |
| 7 | +# |
| 8 | +# https://github.com/HariSekhon/Kubernetes-configs |
| 9 | +# |
| 10 | +# License: see accompanying Hari Sekhon LICENSE file |
| 11 | +# |
| 12 | +# If you're using my code you're welcome to connect with me on LinkedIn |
| 13 | +# and optionally send me feedback to help improve or steer this or other code I publish |
| 14 | +# |
| 15 | +# https://www.linkedin.com/in/HariSekhon |
| 16 | +# |
| 17 | + |
| 18 | +# ============================================================================ # |
| 19 | +# S t o r a g e C l a s s - A W S G P 3 R e s i z e a b l e |
| 20 | +# ============================================================================ # |
| 21 | + |
| 22 | +# Storage Class for AWS GP3 disk that allows clients to resize (increase only) simply via changing their requested allocation size |
| 23 | + |
| 24 | +# https://kubernetes.io/docs/concepts/storage/storage-classes/ |
| 25 | + |
| 26 | +# https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/ |
| 27 | + |
| 28 | +# https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/storage-class-v1/ |
| 29 | + |
| 30 | +# If you have already deployed using the default 'standard' storageclass and want to be able to resize that, you can patch the default storage class to permit it like so: |
| 31 | +# |
| 32 | +# kubectl patch sc ebs-sc -p '{"allowVolumeExpansion": true}' |
| 33 | + |
| 34 | +--- |
| 35 | +apiVersion: storage.k8s.io/v1 |
| 36 | +kind: StorageClass |
| 37 | +metadata: |
| 38 | + # generic name so on another cloud vendor you just replace the storageclass but the deployment / statefulset manifests don't need modifying |
| 39 | + name: standard-resizeable |
| 40 | +provisioner: kubernetes.io/aws-ebs |
| 41 | +parameters: |
| 42 | + type: gp3 |
| 43 | + #fsType: ext4 |
| 44 | +volumeBindingMode: WaitForFirstConsumer |
| 45 | +allowVolumeExpansion: true |
| 46 | +reclaimPolicy: Retain # for safety, else default: Delete |
0 commit comments