forked from intel/pmem-csi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sequence-cache.wsd
170 lines (149 loc) · 4.73 KB
/
sequence-cache.wsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@startuml "pmem-csi-cache-sequence-diagram"
title \nDynamic provisioning of pmem-csi "cache" volume\n
skinparam BoxPadding 40
actor Admin as admin #red
actor User as user
entity Kubernetes as k8s
box "Master node"
entity kubelet as masterkubelet
participant "external-provisioner" as provisioner
participant "external-attacher" as attacher
participant "pmem-csi-driver" as masterdriver
endbox
box "Compute node X"
entity kubelet as nodekubeletX
participant "pmem-csi-driver" as nodedriverX
endbox
box "Compute node Y"
entity kubelet as nodekubeletY
participant "pmem-csi-driver" as nodedriverY
endbox
== Driver setup ==
admin->k8s:Label nvdimm nodes: <b>storage=nvdimm</b>
k8s->admin
' deploy driver
admin->k8s:deploy driver\nkubectl create -f pmem-csi.yaml
k8s->admin
k8s->masterkubelet:start driver pod
masterkubelet-->provisioner:start container
masterkubelet-->attacher:start container
masterkubelet-->masterdriver:start container
note right of masterdriver
listen on tcp port 10000
end note
k8s-->nodekubeletX:start driver pod
nodekubeletX-->nodedriverX:start container
note left of nodedriverX
* prepare logical volume groups
* listen on port 10001
* listen on unix socket:
/var/lib/kubelet/plugins/pmem-csi/csi.sock
end note
nodedriverX->masterdriver:RegistryServer.RegisterNodeController(\n{nodeId:"node-x", endpoint:"http://ip:10001"})
k8s-->nodekubeletY:start driver pod
nodekubeletY-->nodedriverY:start container
note left of nodedriverY
* prepare logical volume groups
* listen on port 10001
* listen on unix socket:
/var/lib/kubelet/plugins/pmem-csi/csi.sock
end note
nodedriverY->masterdriver:RegistryServer.RegisterNodeController(\n{nodeId:"node-y", endpoint:"http://ip:10001"})
' install a storage class
admin->k8s:create StorageClass\nkubectl create -f pmem-storageclass-cache.yaml
note left of k8s
metadata:
name: pmem-csi-sc-cache
volumeBindingMode: <b>Immediate
paramters:
persistencyModel: cache
cacheSize: "2"
end note
k8s->admin
' provision a cache volume
== Volume provisioning ==
admin->k8s:create PVC object\nkubectl create -f pmem-pvc-cache.yaml
note left of k8s
metatdata:
name: pmem-csi-pvc-cache
spec:
storageClassName: pmem-csi-sc-cache
end note
k8s->admin
k8s-->provisioner:<<Event>>\nPersistentVolumeClaim created
activate provisioner
provisioner->masterdriver:CSI.Controller.CreateVolume()
masterdriver->nodedriverX:csi.Controller.CreateVolume()
nodedriverX->nodedriverX:create pmem volume
nodedriverX->masterdriver:success
masterdriver->nodedriverY:csi.Controller.CreateVolume()
nodedriverY->nodedriverY:create pmem volume
nodedriverY->masterdriver:success
masterdriver->provisioner:success
note left of masterdriver
prepare Topology information:
Volume{
accessible_topology: [
segments:{ "pmem-csi.intel.com/node":"node-x"},
segments:{ "pmem-csi.intel.com/node":"node-y"} ]
}
end note
provisioner->k8s:Create PV object
deactivate provisioner
== Volume usage ==
' Start an application
user->k8s:Create application pod
note left of k8s
volumes:
- name: my-csi-volume
persistentVolumeClaim:
claimName: pmem-csi-pvc-cache
end note
k8s->user:success
k8s->nodekubeletX:schedules pod on node-x
note right of k8s
Kubernetes is might choose <b>node-x</b> or <b>node-y</b>.
end note
k8s-->nodekubeletX:make available volume to pod
nodekubeletX->nodedriverX:csi.Node.StageVolume()
activate nodedriverX
nodedriverX->nodedriverX:mount pmem device
nodedriverX->nodekubeletX:success
deactivate nodedriverX
nodekubeletX->nodedriverX:csi.Node.PublishVolume()
activate nodedriverX
nodedriverX->nodedriverX:bind mount pmem device
nodedriverX->nodekubeletX:success
deactivate nodedriverX
' deprovision a cache volume
== Volume Deletion ==
' stop pod
user->k8s:stop applicaiton pod
k8s->user:success
k8s->nodekubeletX:stop pod containers
nodekubeletX->nodedriverX:csi.Node.UnPublishVolume()
activate nodedriverX
nodedriverX->nodedriverX:unmout pod's bind mount
nodedriverX->nodekubeletX:success
deactivate nodedriverX
nodekubeletX->nodedriverX:csi.Node.UnstageVolume()
activate nodedriverX
nodedriverX->nodedriverX:unmount pmem device
nodedriverX->nodekubeletX:success
deactivate nodedriverX
'''''''''''''''''''''''''''
admin->k8s:Delete PVC object\nkubectl delete pvc pmem-pvc-cache
k8s->admin
k8s-->provisioner:<<Event>>\nPersistentVolumeClaim deleted
activate provisioner
provisioner->masterdriver:CSI.Controller.DeleteVolume()
masterdriver->nodedriverX:csi.Controller.DeleteVolume()
nodedriverX->nodedriverX:delete pmem volume
nodedriverX->masterdriver:success
masterdriver->nodedriverY:csi.Controller.DeleteVolume()
nodedriverY->nodedriverY:delete pmem volume
nodedriverY->masterdriver:success
masterdriver->provisioner:success
provisioner->k8s:Delete PV object
deactivate provisioner
@enduml