Created
December 19, 2022 08:23
-
-
Save henryeleonu/235c91bfd299767a369650b58103b44f to your computer and use it in GitHub Desktop.
PersistentVolume and PersistentVolumeClaim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kind: PersistentVolume # Create a PV | |
| apiVersion: v1 | |
| metadata: | |
| name: postgres-pv-volume # Sets PV's name | |
| labels: | |
| type: local # Sets PV's type to local | |
| app: postgres | |
| spec: | |
| storageClassName: manual | |
| capacity: | |
| storage: 1Gi # Sets PV Volume | |
| accessModes: | |
| - ReadWriteMany | |
| hostPath: | |
| path: "/mtd/data" # Sets the volume's path | |
| --- | |
| kind: PersistentVolumeClaim # Create PVC | |
| apiVersion: v1 | |
| metadata: | |
| name: postgres-pv-claim # Sets name of PV | |
| labels: | |
| app: postgres | |
| spec: | |
| storageClassName: manual | |
| accessModes: | |
| - ReadWriteMany # Sets read and write access | |
| resources: | |
| requests: | |
| storage: 1Gi # Sets volume size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment