Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

kubectl apply -f localstorage.yml

Using Default Storage Class with Prebuilt Persistent Volumes


We can create a storage class for our local-storage and use it as default storage. The only issue with doing this with local-storage is that we need to pre-build all of the persistent volumes. Since only 1 claim can be made against a volume, we will need to make a few.


Code Block
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-storage
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: keystone/local-storage
volumeBindingMode: Immediate
reclaimPolicy: Retain
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: local-storage-1
spec:
  capacity:
    storage: 2Gi
  volumeMode: Filesystem
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  local:
    path: /var/pv1
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: NotIn
          values:
          - master
---
...REPEAT UNTIL HAPPY ...


GlusterFS

Gluster-kubernetes is a project to provide Kubernetes administrators a mechanism to easily deploy GlusterFS as a native storage service onto an existing Kubernetes cluster. 

...