Skip to content

Commit

Permalink
added storageclass-aws-standard-resizeable.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Dec 3, 2024
1 parent bfbc824 commit 8f195ee
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions storageclass-aws-standard-resizeable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# Author: Hari Sekhon
# Date: 2024-12-03 19:03:03 +0700 (Tue, 03 Dec 2024)
#
# vim:ts=2:sts=2:sw=2:et
# lint: k8s
#
# https://github.com/HariSekhon/Kubernetes-configs
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn
# and optionally send me feedback to help improve or steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#

# ============================================================================ #
# 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
# ============================================================================ #

# Storage Class for AWS GP3 disk that allows clients to resize (increase only) simply via changing their requested allocation size

# https://kubernetes.io/docs/concepts/storage/storage-classes/

# https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/

# https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/storage-class-v1/

# 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:
#
# kubectl patch sc ebs-sc -p '{"allowVolumeExpansion": true}'

---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
# generic name so on another cloud vendor you just replace the storageclass but the deployment / statefulset manifests don't need modifying
name: standard-resizeable
provisioner: kubernetes.io/aws-ebs
parameters:
type: gp3
#fsType: ext4
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
reclaimPolicy: Retain # for safety, else default: Delete

0 comments on commit 8f195ee

Please sign in to comment.