Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit d01bc59

Browse files
authored
Merge pull request #749 from avalluri/operator-status
operator: revise deployment status API and operator reconcile loop
2 parents 5c1f2b8 + 2003d58 commit d01bc59

File tree

9 files changed

+1727
-971
lines changed

9 files changed

+1727
-971
lines changed

deploy/crd/pmem-csi.intel.com_deployments.yaml

+53-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec:
3030
- jsonPath: .status.phase
3131
name: Status
3232
type: string
33-
- jsonPath: .metatdata.creationTimestamp
33+
- jsonPath: .metadata.creationTimestamp
3434
name: Age
3535
type: date
3636
name: v1alpha1
@@ -180,13 +180,65 @@ spec:
180180
status:
181181
description: DeploymentStatus defines the observed state of Deployment
182182
properties:
183+
conditions:
184+
description: Conditions
185+
items:
186+
properties:
187+
lastUpdateTime:
188+
description: Last time the condition was probed.
189+
format: date-time
190+
type: string
191+
reason:
192+
description: Message human readable text that explain why this
193+
condition is in this state
194+
type: string
195+
status:
196+
description: Status of the condition, one of True, False, Unknown.
197+
type: string
198+
type:
199+
description: Type of condition.
200+
type: string
201+
required:
202+
- status
203+
- type
204+
type: object
205+
type: array
206+
driverComponents:
207+
items:
208+
properties:
209+
component:
210+
description: 'DriverComponent represents type of the driver:
211+
controller or node'
212+
type: string
213+
lastUpdated:
214+
description: LastUpdated time of the driver status
215+
format: date-time
216+
type: string
217+
reason:
218+
description: Reason represents the human readable text that
219+
explains why the driver is in this state.
220+
type: string
221+
status:
222+
description: Status represents the state of the component; one
223+
of `Ready` or `NotReady`. Component becomes `Ready` if all
224+
the instances(Pods) of the driver component are in running
225+
state. Otherwise, `NotReady`.
226+
type: string
227+
required:
228+
- component
229+
- reason
230+
- status
231+
type: object
232+
type: array
183233
lastUpdated:
184234
description: LastUpdated time of the deployment status
185235
format: date-time
186236
type: string
187237
phase:
188238
description: Phase indicates the state of the deployment
189239
type: string
240+
reason:
241+
type: string
190242
type: object
191243
type: object
192244
served: true

docs/install.md

+89-26
Original file line numberDiff line numberDiff line change
@@ -284,36 +284,73 @@ pmem-deployment lvm Running 50s
284284

285285
$ kubectl describe deployment.pmem-csi.intel.com/pmem-csi.intel.com
286286
Name: pmem-csi.intel.com
287-
Namespace: default
287+
Namespace:
288288
Labels: <none>
289289
Annotations: <none>
290290
API Version: pmem-csi.intel.com/v1alpha1
291291
Kind: Deployment
292292
Metadata:
293-
Creation Timestamp: 2020-01-23T13:40:32Z
293+
Creation Timestamp: 2020-10-07T07:31:58Z
294294
Generation: 1
295-
Resource Version: 3596387
296-
Self Link: /apis/pmem-csi.intel.com/v1alpha1/deployments/pmem-csi.intel.com
297-
UID: 454b5961-5aa2-41c3-b774-29fe932ae236
295+
Managed Fields:
296+
API Version: pmem-csi.intel.com/v1alpha1
297+
Fields Type: FieldsV1
298+
fieldsV1:
299+
f:spec:
300+
.:
301+
f:deviceMode:
302+
f:nodeSelector:
303+
.:
304+
f:storage:
305+
Manager: kubectl-create
306+
Operation: Update
307+
Time: 2020-10-07T07:31:58Z
308+
API Version: pmem-csi.intel.com/v1alpha1
309+
Fields Type: FieldsV1
310+
fieldsV1:
311+
f:status:
312+
.:
313+
f:conditions:
314+
f:driverComponents:
315+
f:lastUpdated:
316+
f:phase:
317+
Manager: pmem-csi-operator
318+
Operation: Update
319+
Time: 2020-10-07T07:32:22Z
320+
Resource Version: 1235740
321+
Self Link: /apis/pmem-csi.intel.com/v1alpha1/deployments/pmem-csi.intel.com
322+
UID: d8635490-53fa-4eec-970d-cd4c76f53b23
298323
Spec:
299-
Controller Resources:
300-
Requests:
301-
Cpu: 200m
302-
Memory: 100Mi
303324
Device Mode: lvm
304-
Image: localhost/pmem-csi-driver:canary
305-
Node Resources:
306-
Requests:
307-
Cpu: 200m
308-
Memory: 100Mi
325+
Node Selector:
326+
Storage: pmem
309327
Status:
310-
Phase: Running
328+
Conditions:
329+
Last Update Time: 2020-10-07T07:32:00Z
330+
Reason: Driver certificates are available.
331+
Status: True
332+
Type: CertsReady
333+
Last Update Time: 2020-10-07T07:32:02Z
334+
Reason: Driver deployed successfully.
335+
Status: True
336+
Type: DriverDeployed
337+
Driver Components:
338+
Component: Controller
339+
Last Updated: 2020-10-08T07:45:13Z
340+
Reason: 1 instance(s) of controller driver is running successfully
341+
Status: Ready
342+
Component: Node
343+
Last Updated: 2020-10-08T07:45:11Z
344+
Reason: All 3 node driver pod(s) running successfully
345+
Status: Ready
346+
Last Updated: 2020-10-07T07:32:21Z
347+
Phase: Running
348+
Reason: All driver components are deployed successfully
311349
Events:
312-
Type Reason Age From Message
313-
---- ------ ---- ---- -------
314-
Normal NewDeployment 34s pmem-csi-operator Processing new driver deployment
315-
Normal Running 2s (x10 over 26s) pmem-csi-operator Driver deployment successful
316-
350+
Type Reason Age From Message
351+
---- ------ ---- ---- -------
352+
Normal NewDeployment 58s pmem-csi-operator Processing new driver deployment
353+
Normal Running 39s pmem-csi-operator Driver deployment successful
317354

318355
$ kubectl get po
319356
NAME READY STATUS RESTARTS AGE
@@ -1190,21 +1227,47 @@ active volumes.
11901227

11911228
#### DeploymentStatus
11921229

1193-
A PMEM-CSI Deployment's `status` field is a `DeploymentStatus` object, which has
1194-
a `phase` field. The phase of a Deployment is high-level summary of where the
1195-
Deployment is in it's lifecycle.
1230+
A PMEM-CSI Deployment's `status` field is a `DeploymentStatus` object, which
1231+
carries the detailed state of the driver deployment. It is comprised of [deployment
1232+
conditions](#deployment-conditions), [driver component status](#driver-component-status),
1233+
and a `phase` field. The phase of a Deployment is a high-level summary
1234+
of where the Deployment is in its lifecycle.
11961235

11971236
The possible `phase` values and their meaning are as below:
11981237

11991238
| Value | Meaning |
12001239
|---|---|
12011240
| empty string | A new deployment. |
1202-
| Initializing | All the direct sub-resources of the `Deployment` are created, but some indirect ones (like pods controlled by a daemon set) may still be missing. |
12031241
| Running | The operator has determined that the driver is usable<sup>1</sup>. |
1204-
| Failed | For some reason the state of the `Deployment` failed and cannot be progressed<sup>2</sup>. |
1242+
| Failed | For some reason the state of the `Deployment` failed and cannot be progressed. The failure reason is placed in the `DeploymentStatus.Reason` field. |
12051243

12061244
<sup>1</sup> This check has not been implemented yet. Instead, the deployment goes straight to `Running` after creating sub-resources.
1207-
<sup>2</sup> Failure reason is supposed to be carried by one of additional `DeploymentStatus` field, but not implemented yet.
1245+
1246+
#### Deployment Conditions
1247+
1248+
PMEM-CSI `DeploymentStatus` has an array of `conditions` through which the
1249+
PMEM-CSI Deployment has or has not passed. Below are the possible condition
1250+
types and their meanings:
1251+
1252+
| Condition type | Meaning |
1253+
|---|---|
1254+
| CertsReady | Driver certificates/secrets are available. |
1255+
| CertsVerified | Verified that the provided certificates are valid. |
1256+
| DriverDeployed | All the componentes required for the PMEM-CSI deployment have been deployed. |
1257+
1258+
#### Driver component status
1259+
1260+
PMEM-CSI `DeploymentStatus` has an array of `components` of type `DriverStatus`
1261+
in which the operator records the brief driver components status. This is
1262+
useful to know if all the driver instances of a deployment are ready.
1263+
Below are the fields and their meanings of `DriverStatus`:
1264+
1265+
| Field | Meaning |
1266+
| --- | --- |
1267+
| component | Represents the driver component type; one of `Controller` or `Node`. |
1268+
| status | Represents the state of the component; one of `Ready` or `NotReady`. Component becomes `Ready` if all the instances of the driver component are running. Otherwise, `NotReady`. |
1269+
| reason | A brief message that explains why the component is in this state. |
1270+
| lastUpdateTime | Time at which the status updated. |
12081271

12091272
#### Deployment Events
12101273

0 commit comments

Comments
 (0)