Skip to content

dennyzhang/challenges-k8s-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

1 Kubernetes Storage

linkedin
github
slack


PRs Welcome

Blog URL: https://kubernetes.dennyzhang.com/challenges-k8s-storage, Category: concept

File me Issues or star this repo.

See more Kubernetes sharing from Denny: denny-kubernetes

1.1 Questions

1.1.1 Update configmap, after it has already been mounted to pod. Will the pod get the new version or the old version?

1.1.2 empty_dir vs local vs flexvolume

https://github.com/kubernetes/kubernetes/tree/v1.11.3/pkg/volume

1.1.3 What’s flex volume

FlexVolume Allows Creating Volume Plugins FlexVolume enables users to develop Kubernetes volume plugins for vendor-provided storage.

1.1.4 Deep dive into vsphereVolume

vsphereVolume VMDK Stands for a virtual machine disk (VMDK) provided by the vSphere (VMware).

1.1.5 Can I change volume as readonly after pod is created?

1.1.6 “persistent disk on GCE” vs “regional persistent disk on GCE”

kubernetes/pkg/cloudprovider/providers/gce/gce_disks.go

1.1.7 Why I would need to host DB in containers?

One big benefit of containerize is supporting fast changes. But I won’t upgrade DB version that often.

1.1.8 Performance penalty in DB container?

Why volume mount may result in db performance penalty?

1.1.9 azureFile vs azureDisk

1.2 DONE Questions

1.2.1 DONE why gitRepo volume type gets deprecated?

Discussions for why it gets deprecated:

Use initContainer instead

# Example of using an InitContainer in place of a GitRepo volume.
# Unilke GitRepo volumes, this approach runs the git command in a container,
# with the associated hardening.
apiVersion: v1
kind: Pod
metadata:
  name: git-repo-demo
  annotations:
    seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
spec:
  initContainers:
    # This container clones the desired git repo to the EmptyDir volume.
    - name: git-clone
      image: alpine/git # Any image with git will do
      args:
        - clone
        - --single-branch
        - --
        - https://github.com/kubernetes/kubernetes # Your repo
        - /repo # Put it in the volume
      securityContext:
        runAsUser: 1 # Any non-root user will do. Match to the workload.
        allowPrivilegeEscalation: false
        readOnlyRootFilesystem: true
      volumeMounts:
        - name: git-repo
          mountPath: /repo
  containers:
    # Replace with your actual workload.
    - name:  busybox
      image: busybox
      args: ['sleep', '100000'] # Do nothing
      volumeMounts:
        - name: git-repo
          mountPath: /repo
  volumes:
    - name: git-repo
      emptyDir: {}

1.3 Volume types

https://kubernetes.io/docs/concepts/storage/volumes/#types-of-volumes

https://supergiant.io/blog/persistent-storage-with-persistent-volumes-in-kubernetes

Volume NameStorage TypeDescription
gcePersistentDiskBlock StorageA Google Compute Engine (GCE) Persistent Disk that provides SSD and HDD storage attached to nodes and pods in a K8s cluster.
awsElasticBlockStoreBlock StorageAmazon EBS volume is a persistent block storage volume offering consistent and low-latency performance.
azureFileNetwork File SharesMicrosoft Azure file volumes are fully managed file shares in Microsoft Azure accessible via the industry standard Server Message Block (SMB) protocol.
azureDiskBlock StorageA Microsoft Azure data disk provides block storage with SSD and HDD options.
fcData Center Storage and Storage Area Networks (SAN)Fibre channel is a high-speed networking technology for the lossless delivery of raw block data. FC is primarily used in Storage Area Networks (SAN) and commercial data centers.
FlexVolumeAllows Creating Volume PluginsFlexVolume enables users to develop Kubernetes volume plugins for vendor-provided storage.
flockerContainer Data Storage and ManagementFlocker is an open-source container data volume manager for Dockerized applications. The platform supports container portability across diverse storage types and cloud environments.
nfsNetwork File SystemNFS refers to a distributed file system protocol that allows users to access files over a computer network.
iscsiNetworked Block StorageiSCSI (Internet Small Computer Systems Interface) is an IP-based storage networking protocol for connecting data storage facilities). It is used to facilitate data transfer over intranets and to manage storage over long distances by enabling location-independent data storage.
rbdCeph Block StorageCeph RADOS Block Device (RBD) is a building block of Ceph Block Storage that leverages RADOS capabilities such as snapshotting, consistency, and replication.
cephfsObject Storage and Interfaces for Block and File StorageCeph is a storage platform that implements object storage on a distributed computer cluster.
cinderBlock StorageCinder is a block storage service for openstack designed to provide storage resources to end users that can be used by the OpenStack Compute Project (Nova).
glusterfsNetworked File SystemGluster is a distributed networked file system that aggregates storage from multiple servers into a single storage namespace.
vsphereVolumeVMDKStands for a virtual machine disk (VMDK) provided by the vSphere (VMware).
quobyteData Center File SystemQuobyte volume plugin mounts Quobyte data center file system.
hostPathLocal Cluster File SystemhostPath volumes mounts directories from the host node’s filesystem into a pod.
portworxVolumeBlock StorageA portworxVolume is a Portworx’s elastic block storage layer that runs hyperconverged with Kubernetes. Portworx’s storage system is designed to aggregate capacity across multiple servers similarly to Gluster.
scaleIOShared Block Networked StorageScaleIO is a software-defined storage product from Dell EMC that creates a server-based Storage Area Network (SAN) from local server storage. It is designed to convert direct-attached storage into shared block storage.
storageosBlock StorageStorageOS aggregates storage across a cluster of servers and exposes it as high-throughput and low-latency block storage.

1.4 Volume: local hostPath

Minikube supports PersistentVolumes of type hostPath. These PersistentVolumes are mapped to a directory inside the Minikube VM.

https://github.com/kubernetes/minikube/blob/master/docs/persistent_volumes.md

https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume

https://scalablesystem.design/ds101/local-volume/

There are many problems with hostPath, just to name a few:

  • Unmanaged volume lifecycle
  • Possible path collisions
  • Too many privileges
  • Not portable

1.5 Portworx

https://portworx.com/

1.6 More Resources