Skip to content

Instantly share code, notes, and snippets.

@abdennour
Last active August 26, 2020 07:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdennour/1c445011af3b56ad82f6a6263370b081 to your computer and use it in GitHub Desktop.
Save abdennour/1c445011af3b56ad82f6a6263370b081 to your computer and use it in GitHub Desktop.
Expand kubernetes PVC - Fix No space left on device

0. Collect these info

  • What's your PVC which has space issue ?
  • What's the StorageClassName of that PVC ?

1. Make sure StorageClassName has the following prop :

allowVolumeExpansion: true

https://www.jeffgeerling.com/blog/2019/expanding-k8s-pvs-eks-on-aws

2. Edit PVC spec.resources.requests.storage

spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 30Gi

3. Restart app

# if it's statefulset
k -n namespace rollout restart statefulset/prod-db 

# if it's deployment
k -n namespace rollout restart ddeployment/prod-db 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment