Trivial: code highlight for Event fields in style guide

This commit is contained in:
Joseph Davis 2020-11-13 18:49:02 -08:00
parent d0e97a209b
commit 4b94c80ba8
1 changed files with 7 additions and 7 deletions

View File

@ -41,11 +41,11 @@ The Event should be structured in a way that following sentence "makes sense":
* Regarding PVC X: BoundToNode Node Y - <nil>
* Regarding Pod X: KilledContainer Container Y - NodeMemoryPressure
1. ReportingController is a type of a Controller reporting an Event, e.g. k8s.io/node-controller, k8s.io/kubelet. There will be a standard list for controller names for Kubernetes components. Third-party components must namespace themselves in the same manner as label keys. Validation ensures it's a proper qualified name. This shouldnt be needed in order for users to understand the event, but is provided in case the controllers logs need to be accessed for further debugging.
1. ReportingInstance is an identifier of the instance of the ReportingController which needs to uniquely identify it. I.e. host name can be used only for controllers that are guaranteed to be unique on the host. This requirement isn't met e.g. for scheduler, so it may need a secondary index. For singleton controllers use Node name (or hostname if controller is not running on the Node). Can have at most 128 alpha-numeric characters.
1. Regarding and Related are ObjectReferences. Regarding should represent the object that's implemented by the ReportingController, Related can contain additional information about another object that takes part in or is affected by the Action (see examples).
1. Action is a low-cardinality (meaning that there's a restricted, predefined set of values allowed) CamelCase string field (i.e. its value has to be determined at compile time) that explains what happened with Regarding/what action did the ReportingController take in Regarding's name. The tuple of {ReportingController, Action, Reason} must be unique, such that a user could look up documentation. Can have at most 128 characters.
1. Reason is a low-cardinality CamelCase string field (i.e. its value has to be determined at compile time) that explains why ReportingController took Action. Can have at most 128 characters.
1. Type can be either "Normal" or "Warning". "Warning" types are reserved for Events that represent a situation that's not expected in a healthy cluster and/or healthy workload: something unexpected and/or undesirable, at least if it occurs frequently enough and/or for a long enough duration.
1. Note can contain an arbitrary, high-cardinality, user readable summary of the Event. This field can lose data if deduplication is triggered. Can have at most 1024 characters.
1. `ReportingController` is a type of a Controller reporting an Event, e.g. k8s.io/node-controller, k8s.io/kubelet. There will be a standard list for controller names for Kubernetes components. Third-party components must namespace themselves in the same manner as label keys. Validation ensures it's a proper qualified name. This shouldnt be needed in order for users to understand the event, but is provided in case the controllers logs need to be accessed for further debugging.
1. `ReportingInstance` is an identifier of the instance of the `ReportingController` which needs to uniquely identify it. I.e. host name can be used only for controllers that are guaranteed to be unique on the host. This requirement isn't met e.g. for scheduler, so it may need a secondary index. For singleton controllers use Node name (or hostname if controller is not running on the Node). Can have at most 128 alpha-numeric characters.
1. `Regarding` and `Related` are ObjectReferences. `Regarding` should represent the object that's implemented by the `ReportingController`, `Related` can contain additional information about another object that takes part in or is affected by the `Action` (see examples).
1. `Action` is a low-cardinality (meaning that there's a restricted, predefined set of values allowed) CamelCase string field (i.e. its value has to be determined at compile time) that explains what happened with `Regarding`/what action did the `ReportingController` take in `Regarding`'s name. The tuple of `{ReportingController, Action, Reason}` must be unique, such that a user could look up documentation. Can have at most 128 characters.
1. `Reason` is a low-cardinality CamelCase string field (i.e. its value has to be determined at compile time) that explains why `ReportingController` took `Action`. Can have at most 128 characters.
1. `Type` can be either "Normal" or "Warning". "Warning" types are reserved for Events that represent a situation that's not expected in a healthy cluster and/or healthy workload: something unexpected and/or undesirable, at least if it occurs frequently enough and/or for a long enough duration.
1. `Note` can contain an arbitrary, high-cardinality, user readable summary of the Event. This field can lose data if deduplication is triggered. Can have at most 1024 characters.