generated.proto 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // This file was autogenerated by go-to-protobuf. Do not edit it manually!
  14. syntax = "proto2";
  15. package k8s.io.api.resource.v1alpha3;
  16. import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
  17. import "k8s.io/apimachinery/pkg/runtime/generated.proto";
  18. import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
  19. // Package-wide variables from generator "generated".
  20. option go_package = "k8s.io/api/resource/v1alpha3";
  21. // CELDeviceSelector contains a CEL expression for selecting a device.
  22. message CELDeviceSelector {
  23. // Expression is a CEL expression which evaluates a single device. It
  24. // must evaluate to true when the device under consideration satisfies
  25. // the desired criteria, and false when it does not. Any other result
  26. // is an error and causes allocation of devices to abort.
  27. //
  28. // The expression's input is an object named "device", which carries
  29. // the following properties:
  30. // - driver (string): the name of the driver which defines this device.
  31. // - attributes (map[string]object): the device's attributes, grouped by prefix
  32. // (e.g. device.attributes["dra.example.com"] evaluates to an object with all
  33. // of the attributes which were prefixed by "dra.example.com".
  34. // - capacity (map[string]object): the device's capacities, grouped by prefix.
  35. //
  36. // Example: Consider a device with driver="dra.example.com", which exposes
  37. // two attributes named "model" and "ext.example.com/family" and which
  38. // exposes one capacity named "modules". This input to this expression
  39. // would have the following fields:
  40. //
  41. // device.driver
  42. // device.attributes["dra.example.com"].model
  43. // device.attributes["ext.example.com"].family
  44. // device.capacity["dra.example.com"].modules
  45. //
  46. // The device.driver field can be used to check for a specific driver,
  47. // either as a high-level precondition (i.e. you only want to consider
  48. // devices from this driver) or as part of a multi-clause expression
  49. // that is meant to consider devices from different drivers.
  50. //
  51. // The value type of each attribute is defined by the device
  52. // definition, and users who write these expressions must consult the
  53. // documentation for their specific drivers. The value type of each
  54. // capacity is Quantity.
  55. //
  56. // If an unknown prefix is used as a lookup in either device.attributes
  57. // or device.capacity, an empty map will be returned. Any reference to
  58. // an unknown field will cause an evaluation error and allocation to
  59. // abort.
  60. //
  61. // A robust expression should check for the existence of attributes
  62. // before referencing them.
  63. //
  64. // For ease of use, the cel.bind() function is enabled, and can be used
  65. // to simplify expressions that access multiple attributes with the
  66. // same domain. For example:
  67. //
  68. // cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
  69. //
  70. // The length of the expression must be smaller or equal to 10 Ki. The
  71. // cost of evaluating it is also limited based on the estimated number
  72. // of logical steps.
  73. //
  74. // +required
  75. optional string expression = 1;
  76. }
  77. // DeviceSelector must have exactly one field set.
  78. message DeviceSelector {
  79. // CEL contains a CEL expression for selecting a device.
  80. //
  81. // +optional
  82. // +oneOf=SelectorType
  83. optional CELDeviceSelector cel = 1;
  84. }
  85. // The device this taint is attached to has the "effect" on
  86. // any claim which does not tolerate the taint and, through the claim,
  87. // to pods using the claim.
  88. //
  89. // +protobuf.options.(gogoproto.goproto_stringer)=false
  90. message DeviceTaint {
  91. // The taint key to be applied to a device.
  92. // Must be a label name.
  93. //
  94. // +required
  95. optional string key = 1;
  96. // The taint value corresponding to the taint key.
  97. // Must be a label value.
  98. //
  99. // +optional
  100. optional string value = 2;
  101. // The effect of the taint on claims that do not tolerate the taint
  102. // and through such claims on the pods using them.
  103. //
  104. // Valid effects are None, NoSchedule and NoExecute. PreferNoSchedule as used for
  105. // nodes is not valid here. More effects may get added in the future.
  106. // Consumers must treat unknown effects like None.
  107. //
  108. // +required
  109. optional string effect = 3;
  110. // TimeAdded represents the time at which the taint was added.
  111. // Added automatically during create or update if not set.
  112. //
  113. // +optional
  114. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time timeAdded = 4;
  115. }
  116. // DeviceTaintRule adds one taint to all devices which match the selector.
  117. // This has the same effect as if the taint was specified directly
  118. // in the ResourceSlice by the DRA driver.
  119. message DeviceTaintRule {
  120. // Standard object metadata
  121. // +optional
  122. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  123. // Spec specifies the selector and one taint.
  124. //
  125. // Changing the spec automatically increments the metadata.generation number.
  126. optional DeviceTaintRuleSpec spec = 2;
  127. // Status provides information about what was requested in the spec.
  128. //
  129. // +optional
  130. optional DeviceTaintRuleStatus status = 3;
  131. }
  132. // DeviceTaintRuleList is a collection of DeviceTaintRules.
  133. message DeviceTaintRuleList {
  134. // Standard list metadata
  135. // +optional
  136. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  137. // Items is the list of DeviceTaintRules.
  138. repeated DeviceTaintRule items = 2;
  139. }
  140. // DeviceTaintRuleSpec specifies the selector and one taint.
  141. message DeviceTaintRuleSpec {
  142. // DeviceSelector defines which device(s) the taint is applied to.
  143. // All selector criteria must be satisfied for a device to
  144. // match. The empty selector matches all devices. Without
  145. // a selector, no devices are matches.
  146. //
  147. // +optional
  148. optional DeviceTaintSelector deviceSelector = 1;
  149. // The taint that gets applied to matching devices.
  150. //
  151. // +required
  152. optional DeviceTaint taint = 2;
  153. }
  154. // DeviceTaintRuleStatus provides information about an on-going pod eviction.
  155. message DeviceTaintRuleStatus {
  156. // Conditions provide information about the state of the DeviceTaintRule
  157. // and the cluster at some point in time,
  158. // in a machine-readable and human-readable format.
  159. //
  160. // The following condition is currently defined as part of this API, more may
  161. // get added:
  162. // - Type: EvictionInProgress
  163. // - Status: True if there are currently pods which need to be evicted, False otherwise
  164. // (includes the effects which don't cause eviction).
  165. // - Reason: not specified, may change
  166. // - Message: includes information about number of pending pods and already evicted pods
  167. // in a human-readable format, updated periodically, may change
  168. //
  169. // For `effect: None`, the condition above gets set once for each change to
  170. // the spec, with the message containing information about what would happen
  171. // if the effect was `NoExecute`. This feedback can be used to decide whether
  172. // changing the effect to `NoExecute` will work as intended. It only gets
  173. // set once to avoid having to constantly update the status.
  174. //
  175. // Must have 8 or fewer entries.
  176. //
  177. // +optional
  178. // +listType=map
  179. // +listMapKey=type
  180. // +patchStrategy=merge
  181. // +patchMergeKey=type
  182. repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1;
  183. }
  184. // DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to.
  185. // The empty selector matches all devices. Without a selector, no devices
  186. // are matched.
  187. message DeviceTaintSelector {
  188. // If driver is set, only devices from that driver are selected.
  189. // This fields corresponds to slice.spec.driver.
  190. //
  191. // +optional
  192. optional string driver = 2;
  193. // If pool is set, only devices in that pool are selected.
  194. //
  195. // Also setting the driver name may be useful to avoid
  196. // ambiguity when different drivers use the same pool name,
  197. // but this is not required because selecting pools from
  198. // different drivers may also be useful, for example when
  199. // drivers with node-local devices use the node name as
  200. // their pool name.
  201. //
  202. // +optional
  203. optional string pool = 3;
  204. // If device is set, only devices with that name are selected.
  205. // This field corresponds to slice.spec.devices[].name.
  206. //
  207. // Setting also driver and pool may be required to avoid ambiguity,
  208. // but is not required.
  209. //
  210. // +optional
  211. optional string device = 4;
  212. }