Differences between revisions 3 and 4
Revision 3 as of 2021-10-23 12:08:00
Size: 1031
Editor: PieterSmit
Comment:
Revision 4 as of 2021-10-23 23:53:47
Size: 1558
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 22: Line 22:
 * k8s centralize storage with PersistentVolume, then pods carve pieces with VolumeClaims.  * k8s centralize storage with PersistentVolume, then pods claim matching pv with VolumeClaims.

 * PV(PersistenVolume) on cloud provider still has to manually created.
   * Automate this with Dynamic Provisioning using '''StorageClass''' object
   * e.g. SC auto creates PV(PersistVol) and PVC(PVclaim) grabs disk from SC {{{
apiVersion: storage.k8s.io/v1
kind: storageClass
metadata:
  name: google-storage
provisioner: kubernetes.io/gce-pd
parameters:
  type: pd-standard
  replication-type: none
     }}}
     * In the PVC obj we now refer to the '''storageClassName: google-storage''' defined in SC

k8s/StudyNotes/Storage

  • Docker storage - Storage drivers[aufs,btrfs,etc.] and volume's [Local,VMware,rexray/ebs]
    • /var/lib/docker/ [aufs, containers, image, volumes]
    • Create persistent storage for docker container

           docker volume create data_vol
           docker run -v data_vol:/var/lib/mysql mysql
           # if no pre-created volume docker creates it on the fly
           
           docker run --mount type=bind,source=/data/mysql,target=/varlib/mysql mysql 
        
    • Bind mount form anywhere, volume mount from /var/lib/docker/volumes/
  • k8s - Was just docker, now CRI container runtime interface to support docker,rkt, cri-o

  • k8s volume options [hostPath:, nfs, awsElasticBlockStore:, etc]
  • k8s centralize storage with PersistentVolume, then pods claim matching pv with VolumeClaims.

  • PV(PersistenVolume) on cloud provider still has to manually created.

    • Automate this with Dynamic Provisioning using StorageClass object

    • e.g. SC auto creates PV(PersistVol) and PVC(PVclaim) grabs disk from SC

      apiVersion: storage.k8s.io/v1
      kind: storageClass
      metadata:
        name: google-storage
      provisioner: kubernetes.io/gce-pd
      parameters:
        type: pd-standard
        replication-type: none
      • In the PVC obj we now refer to the storageClassName: google-storage defined in SC

k8s/StudyNotes/Storage (last edited 2021-10-23 23:53:47 by PieterSmit)