This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
/
sequence.wsd
133 lines (116 loc) · 3.7 KB
/
sequence.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
@startuml "pmem-csi-persistent-sequence-diagram"
title \nDynamic provisioning of a pmem-csi persistent 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 "Computee node XYZ"
entity kubelet as nodekubelet
participant "pmem-csi-driver" as nodedriver
endbox
== Driver setup ==
admin->k8s:Label nvdimm nodes: <b>storage=nvdimm</b>
k8s->admin
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-->nodekubelet:start driver pod
nodekubelet-->nodedriver:start container
note left of nodedriver
* prepare logical volume groups
* listen on port 10001
* listen on unix socket:
/var/lib/kubelet/plugins/pmem-csi/csi.sock
end note
nodedriver->masterdriver:RegistryServer.RegisterNodeController(\n{nodeId:"node-xyz", endpoint:"http://ip:10001"})
' install a storage class
admin->k8s:create StorageClass\nkubectl create -f pmem-storageclass.yaml
note left of k8s
metadata:
name: pmem-csi-sc
volumeBindingMode: <b>Immediate
end note
k8s->admin
== Volume provisioning ==
admin->k8s:create PVC object\nkubectl create -f pmem-pvc.yaml
k8s->admin
k8s-->provisioner:<<Event>>\nPersistentVolumeClaim created
activate provisioner
provisioner->masterdriver:CSI.Controller.CreateVolume()
masterdriver->nodedriver:csi.Controller.CreateVolume()
nodedriver->nodedriver:create pmem volume
nodedriver->masterdriver:success
masterdriver->provisioner:success
note left of masterdriver
prepare Topology information:
Volume{
accessible_topology: [ segments:{ "pmem-csi.intel.com/node":"node-xyz"} ]
}
end note
provisioner->k8s:Create PV object
deactivate provisioner
== Volume usage ==
user->k8s:Create application pod
note left of k8s
volumes:
- name: my-csi-volume
persistentVolumeClaim:
claimName: pmem-csi-pvc
end note
k8s->user:success
k8s->nodekubelet:schedules pod on node-xyz
k8s-->nodekubelet:make available volume to pod
nodekubelet->nodedriver:csi.Node.StageVolume()
activate nodedriver
nodedriver->nodedriver:mount pmem device
nodedriver->nodekubelet:success
deactivate nodedriver
nodekubelet->nodedriver:csi.Node.PublishVolume()
activate nodedriver
nodedriver->nodedriver:bind mount pmem device
nodedriver->nodekubelet:success
deactivate nodedriver
' deprovision a cache volume
== Volume Deletion ==
' stop pod
user->k8s:stop applicaiton pod
k8s->user:success
k8s->nodekubelet:stop pod containers
nodekubelet->nodedriver:csi.Node.UnPublishVolume()
activate nodedriver
nodedriver->nodedriver:unmout pod's bind mount
nodedriver->nodekubelet:success
deactivate nodedriver
nodekubelet->nodedriver:csi.Node.UnstageVolume()
activate nodedriver
nodedriver->nodedriver:unmount pmem device
nodedriver->nodekubelet:success
deactivate nodedriver
'''''''''''''''''''''''''''
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->nodedriver:csi.Controller.DeleteVolume()
nodedriver->nodedriver:delete pmem volume
nodedriver->masterdriver:success
masterdriver->nodedriver:csi.Controller.DeleteVolume()
nodedriver->nodedriver:delete pmem volume
nodedriver->masterdriver:success
masterdriver->provisioner:success
provisioner->k8s:Delete PV object
deactivate provisioner
@enduml