28
任玉泉 Kubernetes Storage Architecture and Evolution

任玉泉kubernetes storage architecture and evolution

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 任玉泉kubernetes storage architecture and evolution

任玉泉

Kubernetes Storage Architecture and Evolution

Page 2: 任玉泉kubernetes storage architecture and evolution

Content

kubernetes storage implementation

kubernetes storage future features

kubernetes storage overview

Q&A

kubernetes storage usage evolution

Page 3: 任玉泉kubernetes storage architecture and evolution

Kubernetes Design Principles

Content

• Declarative > imperative: State your desired results, let the system actuate

• Control loops: Observe, rectify, repeat

• Simple > Complex: Try to do as little as possible

• Modularity: Components, interfaces, & plugins

• Legacy compatible: Meet users where they are, requiring apps to change is a non-

starter

• Open > Closed: Open Source, standards, REST, JSON, etc.

Page 4: 任玉泉kubernetes storage architecture and evolution

Storage Architecture Overview

ContentMaster

Kube Controller Manager

Attach/Detach Controller PV/PVC Controller

NodeKubelet

VolumeManager

Mounts

Devices

Kube API Server Containers

Root FSDesired State of World

Actual State of World� Reconciler �

Desired State of World

Actual State of World� Reconciler �

Populator

Operation Executor

Operation Executor

VolumePlugins

PV/PVC/Node/PodInformers

PV/PVC/SC Informers

Volume Queue

Claim Queue

Claim Worker

Volume Worker

GoRoutineMap GoRoutineMap

GoRoutineMap

Populator

PV PVC SC Node Pod

AttacherDetacher

MounterUnmounter

ProvisionerDeleter

VolumePlugins

AttacherDetacher

MounterUnmounter

ProvisionerDeleter

Storage Provider Control Plane

Pod Manager

Expand Controller

Page 5: 任玉泉kubernetes storage architecture and evolution

Kubernetes Supported Storage

ContentPersistent• GCE Persistent Disk• AWS Elastic Block Store• Azure File Storage• Azure Data Disk• iSCSI• Flocker• NFS• vSphere• GlusterFS• Ceph File and RBD• Cinder• Quobyte Volume• FibreChannel• VMWare Photon PD• Portworx• Dell EMC ScaleIO• StorageOS

Ephemeral• Empty dir (and tmpfs)• Expose Kubernetes API

• Secret

• ConfigMap• DownwardAPI

New• Local Storage

Page 6: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Implementation

Content

• Volume Plugin Interface

• Kubelet Volume Manager

• Attach/Detach Controller

• PV/PVC Controller

• ExpandVolume Controller

Page 7: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Implementation

Content

Volume Plugin Interface

• Golang packages in core Kubernetes repository• kubernetes/pkg/volume/

• Implement golang interfaces• Mounter• Unmounter• Optionally

• Attacher• Detacher• Provisioner• Deleter• Recycler

Page 8: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Implementation

Content

Volume Plugin Interface• Mounter/Unmounter Interface

• Make data source (volume, block device, network share, or something else) available as a directory on host’s root FS.

• Directory then mounted into pods by kubelet

• Methods always called from node (Kubelet binary)

• Methods• SetUpAt(dir, ...)• TearDownAt(dir)• ...

Page 9: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Implementation

Content

Volume Plugin Interface• Attacher/Detacher Interface

• Make block device available on specified host.

• Attach & VolumesAreAttached methods called from master (kube controller binary).

• Methods• Attach(spec, nodeName)• VolumesAreAttached

(specs, nodeName)• WaitForAttach

(spec, devicePath, timeout)

• MountDevice(spec, devicePath, deviceMountPath)

• UnmountDevice(deviceMountPath)

• ...

Page 10: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Implementation

Content

Volume Plugin Interface• Provisioner/Deleter Interface

• Create and delete new pieces of physical storage and the k8s PV object to represent it.

• Methods called from master (kube controller binary).

• Methods• Provision()• Delete()

Page 11: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Implementation

Content

Volume Plugin Interface

• Take cinder as an example

• create cinder volume (provision)

• attach to instance

• mount device (/var/lib/kubelet/plugins/kubernetes.io/cinder/mounts/cinder-volume-id)

• mounted to pod volume dir (/var/lib/kubelet/pods/{podUID}/volumes/kubernetes.io~cinder/{outerVolumeSpecName}/)

Page 12: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Implementation

Content

Kubelet Volume ManagerMaster

Kube Controller ManagerAttach/Detach Controller PV/PVC Controller

NodeKubelet

Mounts

Devices

Kube API Server Containers

Root FSDesired State of World

Actual State of World� Reconciler � Operation Executor

Operation Executor

VolumePlugins

PV/PVC/Node/PodInformers

PV/PVC/SC Informers

Volume Queue

Claim Queue

Claim Worker

Volume Worker

GoRoutineMap GoRoutineMap

GoRoutineMap

Populator

PV PVC SC Node Pod

AttacherDetacher

MounterUnmounter

ProvisionerDeleter

VolumePlugins

AttacherDetacher

MounterUnmounter

ProvisionerDeleter

Storage Provider Control Plane

VolumeManagerDesired State of World

● reconciler: compare the in-memory desired and actual states.If different, call operation executor accordingly.

● populator: poll the Pod Manager and populate desired state accordingly.

Actual State of World� Reconciler �

Populator

Pod Manager

Page 13: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Implementation

Content

Attach/Detach ControllerMaster

Kube Controller ManagerAttach/Detach Controller PV/PVC Controller

NodeKubelet

Mounts

Devices

Kube API Server Containers

Root FSDesired State of World

Actual State of World� Reconciler � Operation Executor

Operation Executor

VolumePlugins

PV/PVC/Node/PodInformers

PV/PVC/SC Informers

Volume Queue

Claim Queue

Claim Worker

Volume Worker

GoRoutineMap GoRoutineMap

GoRoutineMap

Populator

PV PVC SC Node Pod

AttacherDetacher

MounterUnmounter

ProvisionerDeleter

VolumePlugins

AttacherDetacher

MounterUnmounter

ProvisionerDeleter

Storage Provider Control Plane

● reconciler: compare the in-memory desired and actual states.If different, call operation executor accordingly.

● populator: periodically add active pods and remove deleted pods got from pod lister

Page 14: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Implementation

Content

PV/PVC ControllerMaster

Kube Controller ManagerAttach/Detach Controller PV/PVC Controller

NodeKubelet

Mounts

Devices

Kube API Server Containers

Root FSDesired State of World

Actual State of World� Reconciler � Operation Executor

Operation Executor

VolumePlugins

PV/PVC/Node/PodInformers

PV/PVC/SC Informers

Volume Queue

Claim Queue

Claim Worker

Volume Worker

GoRoutineMap GoRoutineMap

GoRoutineMap

Populator

PV PVC SC Node Pod

AttacherDetacher

MounterUnmounter

ProvisionerDeleter

VolumePlugins

AttacherDetacher

MounterUnmounter

ProvisionerDeleter

Storage Provider Control Plane

● Controller queues each event and uses it as an opportunity to observe and rectify state of that PV or PVC object.

● syncClaim

● syncVolume

Page 15: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Implementation

Content

ExpandVolume ControllerMaster

Kube Controller ManagerExpand Controller PV/PVC Controller

NodeKubelet

Mounts

Devices

Kube API Server Containers

Root FSDesired State of World

Actual State of World� Reconciler � Operation Executor

Operation Executor

VolumePlugins

PV/PVC/Node/PodInformers

PV/PVC/SC Informers

Volume Queue

Claim Queue

Claim Worker

Volume Worker

GoRoutineMap GoRoutineMap

GoRoutineMap

Populator

PV PVC SC Node Pod

AttacherDetacher

MounterUnmounter

ProvisionerDeleter

VolumePlugins

AttacherDetacher

MounterUnmounter

ProvisionerDeleter

Storage Provider Control Plane

● reconciler: compare the in-memory desired and actual states.If different, call operation executor accordingly.

● populator: periodically add pvcs for resizing

Page 16: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Usage evolution

ContentDirect Access:

Page 17: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Usage evolution

ContentDirect Access:

Page 18: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Usage evolution

Content

Page 19: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Usage evolution

Content

Page 20: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Usage evolution

Content

Page 21: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Usage evolution

Content

Page 22: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Usage evolution

Content

Page 23: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Usage evolution

Content

Page 24: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Future Features

Content

• Local ephemeral storage

• PVC resize

• Local persistent storage

Page 25: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Future Features

Content

• Local ephemeral storage

Page 26: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Future Features

Content• PVC resize

Page 27: 任玉泉kubernetes storage architecture and evolution

Kubernetes Storage Future Features

Content

• Local persistent storage

Page 28: 任玉泉kubernetes storage architecture and evolution

End

Content

Thank you !