k8 by examples
  • k8
  • k8-byexamples-monorepo
  • AWS to GCP Proxy
  • Ingress + TLS Termination
  • Docker
  • HAproxy
  • Troubleshooting
  • Windows
  • Commands
  • Kubernetes Specs
    • Namespaces
    • Deployments
    • InitContainers
    • Ingress
    • Services
    • Storage
      • PersistentVolumeClaims
      • StorageClass
  • Tools
    • kubectl
      • Credentials
    • Port Scanning
  • Resources
    • Curated Resources List
    • Community
    • Contact Me
    • Ingress Controller + LetsEncrypt
  • K8-BYEXAMPLES
    • IngressController+LetsEncrypt
Powered by GitBook
On this page
  1. Kubernetes Specs
  2. Storage

PersistentVolumeClaims

storageClassName can be of "slow" or "fast". "fast" is typically used with cloud providers to indicate SSD type backed storage devices.

pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: fast
  resources:
    requests:
      storage: 100Gi
  persistentVolumeReclaimPolicy: Retain

Changing PV "Reclaim Policy" to "Retain"

kubectl patch pv -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
PreviousStorageNextStorageClass

Last updated 6 years ago