Ssup2 Blog logo Ssup2 Blog

Kubernetes와 동작하는 OpenStack Cinder CSI(Container Storage Interface Plugin을 분석한다.

1. Kubernetes OpenStack Cinder CSI(Container Storage Interface) Plugin

[그림 1] Kubernetes OpenStack Cinder CSI Plugin

[그림 1]은 Kubernetes와 동작하는 OpenStack Cinder CSI Plugin을 나타내고 있다. Cinder CSI Plugin은 CSI Spec의 Controller Plugin 역할과 Node Plugin 역할 모두 수행가능하다. 따라서 Cinder CSI Plugin은 CSI Spec의 Identity Service, Controller Service, Node Service 3가지 Interface를 지원한다. Cinder CSI Plugin중에서 Controller Plugin으로 동작하는 것은 Controller Plugin Pod에서 동작하고, Node Plugin으로 동작하는 것은 Node Plugin Pod에서 동작한다. Controller Plugin Pod은 Master Node 또는 Worker Node에서 동작하고, Node Plugin Pod은 K8s의 Daemonset에 소속되어 모든 Worker Node에서 동작한다.

Controller Plugin Pod에서 동작하는 App들은 cinder-csi-plugin, csi-provisioner, csi-attacher, csi-snapshotter, csi-resizer가 있으며 각각의 Container 안에서 동작한다. HA (High Availability)를 위해서 Controller Plugin Pod이 다수가 동작하는 경우, cinder-csi-plugin App을 제외한 나머지 App의 경우 Active-Standby 형태로 동작한다. 각 App의 역할은 다음과 같다.

Node Plugin Pod에서 동작하는 App들은 cinder-csi-plugin, node-driver-register가 있으며 각각의 Container 안에서 동작한다. 각 App의 역할은 다음과 같다.

cinder-csi-plugin은 OpenStack Provider Project에 소속되있고 나머지 App들은 Kubernetes CSI Project에 소속되어 있다. 다른 CSI Plugin을 이용할 경우 cinder-csi-plugin만 원하는 CSI Plugin으로 교체하면 된다.

[그림 2] Kubernetes OpenStack Cinder CSI Volume Lifecycle

[그림 2]는 Cinder CSI Plugin에서 지원하는 Cinder Volume의 Lifecycle을 나타내고 있다. Created, Node Ready, Volume Ready, Published 4단계 상태가 존재하는 Volume Lifecycle을 이용한다. 각 단계별로 Cinder Volume Create/Delete, Cinder Volume Attach/Detach, Cinder Volume Format, Mount/Unmount, Create/Delete Bind Mount를 진행하는 것을 확인할 수 있다. Bind Mount는 Mount한 Cinder Volume과 Pod의 Volume을 연결하는 과정을 의미한다.

2. 참조