You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Once volume expand is successful, the volume will be marked as expanded and new size will be updated in `pv.spec.capacity`. Any errors will be
107
-
reported as *events* on PVC object.
108
+
* Once volume expand is successful, the volume will be marked as expanded and new size will be updated in `pv.spec.capacity`. Any errors will be reported as *events* on PVC object.
109
+
* If resize failed in above step, in addition to events - `pvc.Status.Conditions` will be updated with `ResizeFailed: True`. Corresponding error will be added to condition field as well.
108
110
* Depending on volume type next steps would be:
109
111
110
-
* If volume is of type that does not require file system resize, then `pvc.status.capacity` will be immediately updated to reflect new size. This would conclude the volume expand operation.
112
+
* If volume is of type that does not require file system resize, then `pvc.status.capacity` will be immediately updated to reflect new size. This would conclude the volume expand operation. Also `pvc.Status.Conditions` will be updated with `Ready: True`.
111
113
* If volume if of type that requires file system resize then a file system resize will be performed on kubelet. Read below for steps that will be performed for file system resize.
112
114
113
115
* If volume plugin is of type that can not do resizing of attached volumes (such as `Cinder`) then `ExpandVolumeDevice` can return error by checking for
@@ -122,13 +124,43 @@ reported as *events* on PVC object.
122
124
123
125
### File system resize on kublet
124
126
127
+
A File system resize will be pending on PVC until a new pod that uses this volume is scheduled somewhere. While theoretically we *can* perform
128
+
online file system resize if volume type and file system supports it - we are leaving it for next iteration of this feature.
129
+
125
130
* When calling `MountDevice` or `Setup` call of volume plugin, volume manager will in addition compare `pv.spec.capacity` and `pvc.status.capacity` and if `pv.spec.capacity` is greater
126
131
than `pvc.status.spec.capacity` then volume manager will additionally resize the file system of volume.
127
132
* The call to resize file system will be performed inside `operation_generator.GenerateMountVolumeFunc`. `VolumeToMount` struct will be enhanced to store PVC as well.
128
133
* Any errors during file system resize will be added as *events* to Pod object and mount operation will be failed.
134
+
* If there are any errors during file system resize `pvc.Status.Conditions` will be updated with `ResizeFailed: True`. Any errors will be added to
135
+
`Conditions` field.
129
136
* File System resize will not be performed on kubelet where volume being attached is ReadOnly. This is similar to pattern being used for performing formatting.
130
-
* After file system resize is successful, `pvc.status.capacity` will be updated to match `pv.spec.capacity` and volume expand operation will be considered complete.
137
+
* After file system resize is successful, `pvc.status.capacity` will be updated to match `pv.spec.capacity` and volume expand operation will be considered complete. Also `pvc.Status.Conditions` will be updated with `Ready: True`.
138
+
139
+
#### Reduce coupling between resize operation and file system type
131
140
141
+
A file system resize in general requires presence of tools such as `resize2fs` or `xfs_growfs` on the host where kubelet is running. There is a concern
142
+
that open coding call to different resize tools direclty in Kubernetes will result in coupling between file system and resize operation. To solve this problem
143
+
we have considered following options:
144
+
145
+
1. Write a library that abstracts away various file system operations, such as - resizing, formatting etc.
146
+
147
+
Pros:
148
+
* Relatively well known pattern
149
+
Cons:
150
+
* Depending on version with which Kubernetes is compiled with, we are still tied to which file systems are supported in which version
151
+
of kubernetes.
152
+
2. Ship a wrapper shell script that encapsulates various file system operations and as long as the shell script supports particular file system
153
+
the resize operation is supported.
154
+
Pros:
155
+
* Kubernetes Admin can easily replace default shell script with her own version and thereby adding support for more file system types.
156
+
Cons:
157
+
* I don't know if there is a pattern that exists in kube today for shipping shell scripts that are called out from code in Kubernetes. Flex is
158
+
different because, none of the flex scripts are shipped with Kuberntes.
159
+
3. Ship resizing tools in a container.
160
+
161
+
162
+
Of all options - #3 is our best bet but we are not quite there yet. Hence, I would like to propose that we ship with support for
163
+
most common file systems in curent release and we revisit this coupling and solve it in next release.
132
164
133
165
## API and UI Design
134
166
@@ -173,6 +205,43 @@ spec:
173
205
174
206
`pvc.spec.resources.requests.storage` field of pvc object will become mutable after this change.
175
207
208
+
In addition to that PVC's status will have a `Conditions []PvcCondition` - which will be used
0 commit comments