Persistent volumes

Contents

    A Persistent Volume is a network-attached storage in the cluster, which is provisioned by the administrator.

    The big picture

    Container Storage Interface (CSI) → API for integrating new Storage backends (block storage, such as AWS Elastic Block Storage).
    New features are added, such as Volume Snapshots abstraction in CSI.

    Volume declaration in pods

    apiVersion: v1
    kind: Pod
    metadata:
      name: my-pod
    spec:
        containers:
        - name: mysql
          image: mysql
          volumeMounts:
          - name: site-data
            mountPath: /var/lib/mysql
        volumes:
        - name: site-data
          persistentVolumeClaim:
            claimName: my-claim-name
    

    Persistent Volume Claim (PVC)

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: my-claim-name
    spec:
      accessModes:
      - ReadWriteOnce
      storageClassName: test
      resources:
        requests:
          storage: 10Gi
    

    Access modes

    Persistent Volume (PV)

    Abstracts a hardware resource in Kubernetes.

    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: pv1
    spec:
      accessModes:
      - ReadWriteOnce
      storageClassName: test
      capacity:
        storage: 10Gi
      persistentVolumeReclaimPolicy: Retain
      gcePersistentDisk:
        pdName: my-harware-or-cloud-disk-on-gce
    

    Important!

    persistentVolumeReclaimPolicy


    Attachments

    Proudly Powered by Zim 0.75.2.

    Template by Etienne Gandrille, based on ZeroFiveEight and using JQuery Toc Plugin.